Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function Person(name, age, job) { = name;
this.age = age;
this.job = job;
this.sayName = 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