javascript anonymous function add arguments dynamic -
i hava question javascript anonymous function.
the origin function:
!function (n) { return n[0].call(1, 2,3); } ([function (n, t, i) {alert(1);}, function (t) {} ]);
my problem how add new function dynamicly anonymous function ' arguments this
!function (n) { return n[0].call(1, 2,3); } ([function (n, t, i) {alert(1);}, function (t) {},function (t) {alert('new function');} ]);
if asking how dynamically add function array of functions:
function f(n) { return n[2].call(1, 2,3); } var functionarray=[ function (n, t, i) {alert(i);}, function (t) {} ]; var fnew= function (t) {alert('new function');} functionarray.push(fnew) f(functionarray);
Comments
Post a Comment