I've been reading MDN guide on Object Oriented programming with Javascript where in an example to show Inheritance, the following is mentioned:
// Create a Student.prototype object that inherits from Person.prototype.
// Note: A common error here is to use "new Person()" to create the
// Student.prototype. That's incorrect for several reasons, not least
// that we don't have anything to give Person for the "firstName"
// argument. The correct place to call Person is above, where we call
// it from Student.
Student.prototype = Object.create(Person.prototype); // See note below
I've looked into other answers as well, but they don't specifically tell what problems one will face on using Student.prototype = new Person()
One problem mentioned above concerns with passing firstName, but that's just one scenario.
Before anyone marks this as duplicate. The question here Using "Object.create" instead of "new" deals with generally using Object.create instead of constructors and not with what I'm asking.
The question here What is the reason to use the 'new' keyword at Derived.prototype = new Base deals with difference between foo() and new foo()
One answer for this question JavaScript inheritance: Object.create vs new gives one more reason:
When SomeBaseClass has a function body, this would get executed with the new keyword. This usually is not intended - you only want to set up the prototype chain. In some cases it even could cause serious issues because you actually instantiate an object, whose private-scoped variables are shared by all MyClass instances as they inherit the same privileged methods. Other side effects are imaginable.
So, you should generally prefer Object.create. Yet, it is not supported in some legacy browsers; which is the reason you see the new-approach much too frequent as it often does no (obvious) harm. Also have a look at this answer.
Reading the above it seems it depends more on the given scenario being tackled. Is there a stringent reason for MDN saying using new SuperClass() is incorrect?