0
我的問題是共同但有極少數情況下,我的陣列的輸出是如何找到的foreach倒數第二個索引號法
#0 : [ 'a', 'b', 'c' ]
#1 : [ 'd', 'e', 'f' ]
#2 : [ 'v', 'h', 'f' ]
#3 : [ 'd', 'y', 'z' ]
#4 : [ 'k', 'q', 'f' ]
如何找到這種類型的數組倒數第二個索引號爲3?
forEach(response, ',', function(row, index)
{
console.log('#' + index + ' : ', row);
console.log(index.length)//undefined
})
它是索引數組還是關聯? – Justinas
數組有一個'length'屬性 - 是否可以引導您回答問題? –
索引數組輸出代碼高於 –