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

Class checking: "instanceof" misleading sentence and example. #3747

Open
fjavier-jp opened this issue Aug 17, 2024 · 1 comment
Open

Class checking: "instanceof" misleading sentence and example. #3747

fjavier-jp opened this issue Aug 17, 2024 · 1 comment

Comments

@fjavier-jp
Copy link

Great tutorial, thanks so much!
Since the comment section was removed, just wanted to add here a correction. In the parragraph: "It also works with constructor functions:" the example below is not a constructor function. What you are using is precisely an instance of Rabbit, but in the form of "new Rabbit()". It could be misleading to say that the instanceof operator works with constructor functions.

@joaquinelio
Copy link
Member

I think it IS a constructor,
it's not THE constructor()

Constructor functions were there in js before class syntax was implemented

Maybe
"Also Works with instances from constructor functions "
I would ask another opinion

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