Skip to content

Instantly share code, notes, and snippets.

@labajo
Created August 20, 2013 20:08
Show Gist options
  • Save labajo/6286570 to your computer and use it in GitHub Desktop.
Save labajo/6286570 to your computer and use it in GitHub Desktop.
apply method example
var incAge = function incAge(incValue) {
return this.age + incValue;
}
var BirthDayBoy = function BirthDayBoy(){
this.age = 12;
};
var boy = new BirthDayBoy();
var finalAge = incAge.apply(boy, [1]);
console.log(finalAge);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment