【发布时间】:2014-11-16 22:59:11
【问题描述】:
我在 jQuery 中推送到一个数组,之后我无法在该数组上执行 .each,这是什么原因造成的?
Fiddle
var sections = [];
for (var j = 0; j < 15; j++) {
sections.push("tests-" + j);
}
console.log(sections); // this is a proper array
sections.each(function(){
console.log("test"); // Uncaught TypeError: undefined is not a function
});
【问题讨论】: