for (index=1; index<=15; index++) {
if (undefined != sku[index]) {
found = jQuery.inArray(sku[index], mr_sku);
if( found == -1){ //not in array
alert( sku[index] + " NOT FOUND - delete index " + index );
} else { // in array
alert("FOUND");
}
}
}
两个数组 - sku 和 mr_sku = 试图找到从 1 到 15 的值,其中未定义值在两个数组中。sku[1] 和 mr_sku 我知道是相同的值 - 只是永远不会在数组中显示为 bieng - inarray 总是返回为 -1