Menu
[code]function Person(firstName) {
var _firstName = firstName;
};
Object.defineProperty(Person, “firstName”, {
get: function() {
return this._firstName;
},
set: function(value) {
this._firstName = value;
},
configurable: true,
enumberable: true
});
var p = new Person(“John”);
console.log(p.firstName); // WHY IS THIS UNDEFINED???
Would appreciate any help anyone can provide. Thanks in advance.