More specifically:
[in] var d = function(l, m) {
console.log(l);
console.log(m);
}
[in] d.apply(window, [1,2])
[out] 1
[out] 2
[out-return-value] undefined
[in] d.bind(window, [1,2])()
[out] [1, 2]
[out] undefined
[out-return-value] undefined
As can be seen, arrays are unpacked with .apply()
, but not with .bind()
. Is there any way to unpack the arguments with .bind()
?