fixed waypoint ins .hasOwnProperty([propname])
This commit is contained in:
parent
f6f0ed0b57
commit
84dec60b0b
@ -3421,7 +3421,7 @@
|
||||
"id": "567af2437cbaa8c51670a16c",
|
||||
"title": "Testing Objects for Properties",
|
||||
"description": [
|
||||
"Sometimes it is useful to check if the property of a given object exists or not. We can use the <code>.hasOwnProperty([propname])</code> method of objects to determine if that object has the given property name. <code>.hasOwnProperty()</code> returns <code>true</code> or <code>false</code> if the property is found or not.",
|
||||
"Sometimes it is useful to check if the property of a given object exists or not. We can use the <code>.hasOwnProperty(propname)</code> method of objects to determine if that object has the given property name. <code>.hasOwnProperty()</code> returns <code>true</code> or <code>false</code> if the property is found or not.",
|
||||
"<strong>Example</strong>",
|
||||
"<blockquote>var myObj = {<br> top: \"hat\",<br> bottom: \"pants\"<br>};<br>myObj.hasOwnProperty(\"top\"); // true<br>myObj.hasOwnProperty(\"middle\"); // false</blockquote>",
|
||||
"<h4>Instructions</h4>",
|
||||
|
Loading…
x
Reference in New Issue
Block a user