2
原型中的list.detect的等價物是什麼?原型中的list.detect的jquery等價物
原型中的list.detect的等價物是什麼?原型中的list.detect的jquery等價物
返回第一個元素的索引爲「值」:
jQuery.inArray(value, array);
Prototype的檢測需要的迭代求使迭代返回true的第一個元素。 jQuery的inArray不包括這個功能。 jQuery的grep()是一個更好的匹配IMO。