Clarify "Accessing Objects Properties with Bracket Notation" description
Related to when you need to use the bracket notation
This commit is contained in:
@ -4282,7 +4282,7 @@
|
||||
"id": "56533eb9ac21ba0edf2244c8",
|
||||
"title": "Accessing Objects Properties with Bracket Notation",
|
||||
"description": [
|
||||
"The second way to access the properties of an object is bracket notation (<code>[]</code>). If the property of the object you are trying to access has a space in it, you will need to use bracket notation.",
|
||||
"The second way to access the properties of an object is bracket notation (<code>[]</code>). If the property of the object you are trying to access has a space in it's name, you will need to use bracket notation.",
|
||||
"Here is a sample of using bracket notation to read an object property:",
|
||||
"<blockquote>var myObj = {<br> \"Space Name\": \"Kirk\",<br> \"More Space\": \"Spock\"<br>};<br>myObj[\"Space Name\"]; // Kirk<br>myObj['More Space']; // Spock</blockquote>",
|
||||
"Note that property names with spaces in them must be in quotes (single or double).",
|
||||
|
Reference in New Issue
Block a user