2
原型中的list.detect的等价物是什么?原型中的list.detect的jquery等价物
原型中的list.detect的等价物是什么?原型中的list.detect的jquery等价物
返回第一个元素的索引为“值”:
jQuery.inArray(value, array);
Prototype的检测需要的迭代求使迭代返回true的第一个元素。 jQuery的inArray不包括这个功能。 jQuery的grep()是一个更好的匹配IMO。