This is my function to delete unwanted array value.
function deleteValue(array1,array2) {
var len = array2.length;
for (var i=0; i<len;i++) {
if (array2[i] ==array1)
{ array2.splice(i,1)}
}
return array2;
};
But it doesnt work.
My two array look like this:
array1 is an array inside a nested array (array2)
array1 = [1,2,3,4];
array2 = [[1,2,3,4],[5,6,7,8]];
array1 looks the same as array2[0]
But if I Boolean(array1==array2[0])
it always return false.
Is it the type problem?