From cb38fe6465c6eee22915f67bf008a924b21bd733 Mon Sep 17 00:00:00 2001 From: Amartya Chaudhuri Date: Wed, 3 May 2017 22:22:34 +0530 Subject: [PATCH] Added semicolon after object initialization (#14684) Not mandatory but adding for the sake of consistency of tutorials. --- .../basic-javascript.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json b/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json index b5101112f21..cee48d47b33 100755 --- a/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json @@ -4294,9 +4294,9 @@ "description": [ "Another use of bracket notation on objects is to use a variable to access a property. This can be very useful for iterating through lists of the object properties or for doing the lookup.", "Here is an example of using a variable to access a property:", - "
var someProp = \"propName\";
var myObj = {
propName: \"Some Value\"
}
myObj[someProp]; // \"Some Value\"
", + "
var someProp = \"propName\";
var myObj = {
propName: \"Some Value\"
};
myObj[someProp]; // \"Some Value\"
", "Here is one more:", - "
var myDog = \"Hunter\";
var dogs = {
Fido: \"Mutt\",\n Hunter: \"Doberman\",\n Snoopie: \"Beagle\"
}
var breed = dogs[myDog];
console.log(breed);// \"Doberman\"
", + "
var myDog = \"Hunter\";
var dogs = {
Fido: \"Mutt\",\n Hunter: \"Doberman\",\n Snoopie: \"Beagle\"
};
var breed = dogs[myDog];
console.log(breed);// \"Doberman\"
", "Note that we do not use quotes around the variable name when using it to access the property because we are using the value of the variable, not the name.", "
", "Use the playerNumber variable to look up player 16 in testObj using bracket notation. Then assign that name to the player variable."