< JavaScript < Reserved words
The instanceof keyword
The instanceof keyword returns true, if the left-hand side of the operator corresponds to the class on the right-hand side.
Syntax
object instanceof class
Examples
theArray = new Array();
if (theArray instanceof Array) {
for (var i = 0; i < theArray.length; i++) {
[…]
}
}
This article is issued from
Wikibooks.
The text is licensed under Creative
Commons - Attribution - Sharealike.
Additional terms may apply for the media files.