A RetroSearch Logo

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

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/Object/hasOwnProperty below:

hasOwnProperty · WebPlatform Docs

hasOwnProperty Summary

Determines whether an object has a property with the specified name.

Syntax
hasOwnProperty( proName )
proName
Required. String value of a property name.
Examples

In the following example, all String objects share a common split method. The following code will display false and true.

var s = new String("Sample");
 document.write(s.hasOwnProperty("split"));
 document.write("<br/>");
 document.write(String.prototype.hasOwnProperty("split"));

 
 
 
Remarks

The hasOwnProperty method returns true if object has a property of the specified name, false if it does not. This method does not check the properties in the object’s prototype chain; the property must be a member of the object itself.

See also Specification

15.2.4.5 Object.prototype.hasOwnProperty (V) ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011

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