Table of Contents
- What is Instanceof?
- Syntax and explanation
- Other Related Concepts
Syntax and explanationSyntax:
objectName: Signifies the name of the object.
Instanceof operator also takes inheritance into account. It returns true if the object inherits from the classes’ prototype.
Syntax and explanation
It returns true if obj belongs to the Class or a class inheriting from it.