A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/operators/in below:

in · WebPlatform Docs

in Summary

Tests for the existence of a property in an object.

Syntax
result = property in object
result
Required. Any variable.
property
Required. An expression that evaluates to a string expression.
object
Required. Any object.
Examples

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.

Attributions

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