I am trying to check if all my values are defined in an array of mine. My code is the following
var check = function (item){return item !== undefined;};
array.every(check);
I tried it on the following arrays:
var array = [];
array[5] = 0; //[undefined × 5, 0]
array.every(check); //return true although there are 5 udefined values there
What am I doing wrong?