Clarify "Accessing Objects Properties with Bracket Notation" description

Related to when you need to use the bracket notation
This commit is contained in:
Nicolás Quiroz
2016-07-31 11:39:41 -03:00
committed by GitHub
parent e06e3162a8
commit 8f6fd8fa45

View File

@ -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).",