0
例子:PHPJS」和array_diff返回undefined
我試圖使用array_diff
功能從PHPJS,檢查所有內部selectedFeatures
的元素在裏面elem.features
發現,但是我收到undefined
。是什麼賦予了?
$(markers.houses).each(function(index, elem) {
//first filter by selected features
console.log(array_diff(elem.features, selectedFeatures).length);
if (array_diff(selectedFeatures, elem.features).length == 0) {
if (!markers.houseMarkers[index].visible) {
markers.houseMarkers[index].setVisible(true);
}
}
});