I used this answer here to construct a new class instance by passing array arguments using the following code:
new ( Cls.bind.apply( Cls, arguments ) )();
But one of my arguments is an array and the values get lost during construction
You can check an example that demonstrates this in this CodePen
In the example I pass the third argument properties
:
var properties = [
{ name: "first", value: "1" },
{ name: "second", value: "2" },
{ name: "third", value: "3" }
];
But the properties in the result is undefined
.
Apparently something goes wrong here, but what and why?