Tests for the existence of a property in an object.
Syntaxresult = property in object
The following example shows how to use the in operator:
var myObject = new Object();
myObject.name = "James";
myObject.age = "22";
myObject.phone = "555 0234";
if ("phone" in myObject)
document.write ("property is present");
else
document.write ("property is not present");
Remarks
The in operator determines whether an object has a property named property. It also determines whether the property is part of the object’s prototype chain. For more information about object prototypes, see Prototypes and Prototype Inheritance.
AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4