jquery 中$.each和foreach的區別

forEach(): var a = [1,1,1,1,1,1,1]; //forEach與map的參數順序與jquery each $.each的順序正好相反,js的順序爲,先element再index //forEach() 對於空數組是不會執行回調函數的。 a.forEach(function(element,index,arr){ console.log(element,inde
相關文章
相關標籤/搜索