-2
我使用jQuery和Lodash,並想不通這是爲什麼返回undefined:爲什麼這個日誌記錄是未定義的?
$.each(someArray, function(i) {
var x = _.find(someObject, function(item) {
return item.Id === someArray[i]
});
console.log('x')
console.log(x)
});
什麼是'someObject',什麼是'someArray'?給定'let someArray = [2],someObject = [{Id:2,Label:'String'}];',我不明白。 –