fix(challenges): Fix typo in code example (#16866)

pull/16909/head
Seth Wilson 2018-03-16 10:45:35 -05:00 committed by mrugesh mohapatra
parent 8145a9ceb1
commit bce8e0a5e9
1 changed files with 2 additions and 2 deletions

View File

@ -4413,8 +4413,8 @@
"Here is an example of using a variable to access a property:", "Here is an example of using a variable to access a property:",
"<blockquote>var dogs = {<br> Fido: \"Mutt\",\n Hunter: \"Doberman\",\n Snoopie: \"Beagle\"<br>};<br>var myDog = \"Hunter\";<br>var myBreed = dogs[myDog];<br>console.log(myBreed); // \"Doberman\"</blockquote>", "<blockquote>var dogs = {<br> Fido: \"Mutt\",\n Hunter: \"Doberman\",\n Snoopie: \"Beagle\"<br>};<br>var myDog = \"Hunter\";<br>var myBreed = dogs[myDog];<br>console.log(myBreed); // \"Doberman\"</blockquote>",
"Another way you can use this concept is when the property's name is collected dynamically during the program execution, as follows:", "Another way you can use this concept is when the property's name is collected dynamically during the program execution, as follows:",
"<blockquote>var someObj = {<br> propName: \"John\"<br>};<br>function propPrefix(str) {<br> var s = \"prop\";<br> return s + str;<br>}<br>var someProp = propPrefix(\"Name\"); // someProp now holds the value 'propName'<br>console.log(obj[someProp]); // \"John\"</blockquote>", "<blockquote>var someObj = {<br> propName: \"John\"<br>};<br>function propPrefix(str) {<br> var s = \"prop\";<br> return s + str;<br>}<br>var someProp = propPrefix(\"Name\"); // someProp now holds the value 'propName'<br>console.log(someObj[someProp]); // \"John\"</blockquote>",
"Note that we do <em>not</em> use quotes around the variable name when using it to access the property because we are using the <em>value</em> of the variable, not the <em>name</em>.", "Note that we do <em>not</em> use quotes around the variable name when using it to access the property because we are using the <em>value</em> of the variable, not the <em>name</em>.",
"<hr>", "<hr>",
"Use the <code>playerNumber</code> variable to look up player <code>16</code> in <code>testObj</code> using bracket notation. Then assign that name to the <code>player</code> variable." "Use the <code>playerNumber</code> variable to look up player <code>16</code> in <code>testObj</code> using bracket notation. Then assign that name to the <code>player</code> variable."
], ],