Ad
  • Custom User Avatar

    Another problem with not returning this arises, when you try to check whether your created object is an instance of NameMe or not.

    var person = new NameMe('John', 'Doe');
    person instanceof NameMe; // false, if you return a new object, which this solution does.
    

    :)

  • Custom User Avatar

    Since there are no prototype changes, it does not matter. Wouldn't best practice be to use "this" for any constructor function?

    This is obviously an intro repo meant to teach about the constructor functions. A workaround that defeats the purpose of the constructor does not seem it should be a preferred solution.