Take a simple anonymous function which accepts 3 parameters:
function hello(firstname, surname, city) {
console.log('Hi ' + firstname + ' ' +
surname + '. I see you\'re from ' + city)
}
What is the benefit of calling this function using the function method "call" over say just calling the function?, ie.
hello('Jane','Mansfield','Philadelphia');
vs
hello.call(this,'Jane','Mansfield','Philadelphia');
Fiddle-dee-dee: http://jsfiddle.net/wC3xz/1/
Sorry, but looking at the docs hasn't shed any light. The only thing I can think of is if you can gain access to the this object passed to the function. But wouldn't accessing this from within the anonymous function be this in the context of the anonymous function ie the window?
When is call needed instead of just functionname(args)?