17

Few days ago I wrote function that finds occurrence of value in array:

function findOccurrence(value, array) {
for (var i = 0; i < array.length; i++) {
if (value === array[I]) return true;
}
return false;
}

But there's already [].includes() function in JavaScript.

Comments
Add Comment