3
我用this answer here通过使用下面的代码传递数组参数构造一个新的类实例:参数使用绑定时丢失应用与数组参数
new (Cls.bind.apply(Cls, arguments))();
但我的论据之一是数组和值获得建设
过程中丢失,您可以查看演示此in this CodePen
在我传递的第三个参数properties
的例子为例:
var properties = [
{ name: "first", value: "1" },
{ name: "second", value: "2" },
{ name: "third", value: "3" }
];
但是结果中的属性是undefined
。
显然这里出了问题,但是什么?为什么?
男人,这是愚蠢的... – Wilt
我应该注意到它,我只需要更仔细地看看输出... – Wilt