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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -