Created
August 3, 2012 22:43
-
-
Save toranb/3252318 to your computer and use it in GitHub Desktop.
How the new keyword works in javascript part 1
This file contains hidden or 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 Animal = function(omnivore) { | |
| this.omnivore = omnivore; | |
| } | |
| var human = new Animal(true); | |
| console.log("the human is an omnivore " + human.omnivore); | |
| //this will print "the human is an omnivore true" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment