Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong term used in class article #3788

Open
jai-sanghvi opened this issue Nov 22, 2024 · 1 comment
Open

Wrong term used in class article #3788

jai-sanghvi opened this issue Nov 22, 2024 · 1 comment

Comments

@jai-sanghvi
Copy link

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

@MorganVonBrylan
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants