Is there an alternative to using array.some()? I've had it in my code for a while but I just learned that its not supported by IE8.
My original code:
var list = ['Johny', 'Adam', 'Johny'];
var option = 'Johny';
var foundInList = list.some(function (el) {
return el === option;
});
I could replace it with something like :
var test = false;
for (i = 0; i < list.length; i++){
if (list[i] === option){
test = true;
break;
}
}
But there may be a better way to do the same.
Please help. Thanks in Advance
PS: Here's a fiddle