JavaScript/Reserved words/instanceof
< JavaScript | Reserved words
(Redirected from JavaScript/Reserved Words/instanceof)The instanceof keyword edit
The instanceof keyword returns true, if the left-hand side of the operator corresponds to the class on the right-hand side.
Syntax edit
object instanceof class
Examples edit
theArray = new Array();
if (theArray instanceof Array) {
for (var i = 0; i < theArray.length; i++) {
[…]
}
}