Created
August 20, 2013 20:08
-
-
Save labajo/6286570 to your computer and use it in GitHub Desktop.
apply method example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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