Created
November 10, 2013 20:39
-
-
Save baisa/7403638 to your computer and use it in GitHub Desktop.
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
function Person(name,age) { | |
this.name = name; | |
this.age = age; | |
} | |
// Let's make bob and susan again, using our constructor | |
var bob = Person("Bob Smith", 30); | |
var susan = new Person("Susan Jordan", 25); | |
console.log(bob) | |
console.log(this.name) | |
console.log(this.age) | |
console.log(susan) | |
console.log(susan.name) | |
console.log(susan.age) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment