我正在编写一个 Javascript 函数,该函数将操纵动态编写并作为参数发送的数组。
函数编写如下:
function returnJourney(animation,clean){
var properties = {};
// loads of other inane stuff
for(i in animation[0]) properties[animation[0][i]] = animation[0].i;
// heaps more inane stuff
}
有问题的动画是 jQuery 动画的一组参数。通常它采用({key:value,key:value},speedAsInteger,modifierAsString)
.
因此,为了启动初始调试,我将其称为:
returnJouney(({'foo':'bar'},3000),1);
事情马上就结束了。据我所见,这将具有 returnJourney acknowledge clean === 1
,并且animation
是一个以对象作为其第一个子对象和数字 3000 作为其第二个子对象的数组。
Firebug 告诉我animation
评估为数字 3000。我做错了什么?