Difference between call and apply in JavaScript
One of the very common thing which confuse you while writing JavaScript is knowing when to use “call” and when to use “apply”. Let’s look at following example: var person1 = {name: ‘John’, age: 52, size: ‘2X’}; var person2 = {name: ‘Jane’, age: 26, size: ‘5X’}; var sayHello = function(){ alert(‘Hello, ‘ + this.name); }; […]