I would like to use an array of functions ins in a jquery each loop and pass parameters to sad functions.
Something like what is below.
var test = function(x) { return x+1;};
var test2 = function (x) { return x+2};
var mark = [test,test2];
mark.each(function() { $(this)(3)});
expected result
4
5
how do I achieve this.
Working example of answer
var test = function(x) { return x+1;};
var test2 = function (x) { return x+2;};
var mark = [test,test2]; $.each(mark, function () {
console.log( this(3));
});