UNPKG

localforage

Version:
19 lines (15 loc) 386 B
const sameValue = (x, y) => x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y)); const includes = (array, searchElement) => { const len = array.length; let i = 0; while (i < len) { if (sameValue(array[i], searchElement)) { return true; } i++; } return false; }; export default includes;