A Pen by Stephen Davies on CodePen.
Created
December 12, 2014 13:36
-
-
Save stiofand/27765848fa49d98461e2 to your computer and use it in GitHub Desktop.
vEGmoP
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, job) { | |
this.name = name; | |
this.age = age; | |
this.job = job; | |
this.sayName = function() { | |
console.log(this.name); | |
}; | |
} | |
(function(){ | |
var p = new Person("Jo",20,"dev"); | |
console.log(typeof new Person); | |
console.log(typeof Person); | |
console.log(typeof p); | |
console.log(p.sayName()); // Why do you think this is undefined? | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment