Constructor confusion ... JS Newbie
In codecademys JS course, a class is defined as an object blueprint, and to call it you must add the constructor function (
To create an instance, you then use the
But on javascript.info this is the definition of a constructor function:
... basically the class definition from codecademy, without the specific
So what is a constructor function??? Is it required to use the
constructor()):To create an instance, you then use the
new keyword ...But on javascript.info this is the definition of a constructor function:
... basically the class definition from codecademy, without the specific
constructor() syntax ...So what is a constructor function??? Is it required to use the
constructor() or not??