en.javascript.info
en.javascript.info copied to clipboard
Wrong term used in class article
In the chapter "Class basic syntax", in the second example of "what is a class" section, on line 15 of the code it is written in the comment that "there are exactly two methods in the prototype" (constructor, sayHi) which I believe is wrong as constructor is a property referencing the constructor function, right? So shouldn't it be "there are exactly two properties" or maybe "two keys"?
Link to the section - https://javascript.info/class#what-is-a-class
Yes, constructor is a reference to a function. So is sayHi. This is how JS functions work.
Them being in an object makes them, by definition, methods.