这太简单了,我很困惑。我有以下内容:
var x = 'shrimp';
var stypes = new Array('shrimp', 'crabs', 'oysters', 'fin_fish', 'crawfish', 'alligator');
for (t in stypes) {
if (stypes[t] != x) {
alert(stypes[t]);
}
}
一旦值迭代,它就会开始返回十几个函数,例如
function (iterator, context) {
var index = 0;
iterator = iterator.bind(context);
try {
this._each(function (value) {iterator(value, index++);});
} catch (e) {
if (e != $break) {
throw e;
}
}
return this;
}
到底他妈发生了什么?
编辑:在这些脚本中,我使用http://script.aculo.us/prototype.js和http://script.aculo.us/scriptaculous.js 我记得现在阅读原型扩展数组的方式,我打赌这个是其中的一部分。我该如何处理?