frontend/.pnpm-store/v3/files/f5/1fddd0d2cad24bd3ee43caebdbffe5c7b3a4f8be61f72af979b750820a2052d902b07d0ffc9c0389f355ef9efe2cc30586f241c22ebf5acbec10e925c2e4b8

19 lines
386 B
Plaintext

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;