en.javascript.info
en.javascript.info copied to clipboard
Class checking: "instanceof" misleading sentence and example.
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.
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