I have a JavaScript object:
function Thing() {
this.number = 4;
}
I create an instance and assign a new property:
var myThing = new Thing();
myThing.newProperty = 5;
console.log(myThing.newProperty);
and the output is:
5
undefined
Why is the output also printing undefined?