News for hackers. Stuff that matters.
Re:Replacing ‘that = this’ assignments in JavaScript with Ar... by hdhzy on Friday April 14, 2017 @02:43PM (#14116260)
The algorithm for "var p = new Person" is roughly (ignoring prototypes):

    var p = {};
    Person.call(p); // calls Person with p as this
Remember that in js there are no "methods" just functions. The original constructor function can be accessed by "constructor" property: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

There are no comments on this comment yet.