Monday, February 13, 2012

Function.apply and in JavaScript

Function.apply and in JavaScript: "We can also pass arguments to the target function via call():

var x = 10;
var o = { x: 15 };
function f(message)

f("invoking f");, "invoking f via call");
The apply() method is identical to call(), except apply() requires an array as the second parameter. The array represents the arguments for the target method."

'via Blog this'