June 2016
JS, Understanding Weird parts-3 (sec 5, OOP & Prototype)
var foo = new Person(); “new” is an operator in JavaScript. So, when we say “new”, something special happens. Immediately an empty object is created and invokes the function. When the function is called, in this case it changes the pointer of “this” to the newly created object.