2009-04-10 [javascript] 尋找陣列索引 2630 0 javascript 2009-04-15 摘要:[javascript] 尋找陣列索引 Array.prototype.findIndex = function(value){ var ctr = ""; for (var i=0; i < this.length; i++) { // use === to check for Matches. ie., identical (===), ; if (this[i] == value) { return i; } } return -1; }; Javascript 回首頁