2
有沒有更好的方法來找到價值?如何簡化代碼?
let arrData = [[1, 0], [74, 0], [75, 1], [76, 1], [79, 1], [80, 0], [81, 0], [82, 0], [83, 1], [84, 0], [85, 0], [86, 0]];
let isn = 75;
function searchCount(arr, isn) {
for(var i = 0; i < arr.length; i++){
if(arr[i][0] == isn){
return arr[i][1];
}
}
}
console.log(searchCount(arrData, isn));