diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json index b255a114ec..4cce7dc64d 100644 --- a/seed/challenges/01-front-end-development-certification/basic-javascript.json +++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json @@ -4329,6 +4329,13 @@ "
var ourMusic = [", "This is an array of objects and the object has various pieces of metadata about an album. It also has a nested
{
\"artist\": \"Daft Punk\",
\"title\": \"Homework\",
\"release_year\": 1997,
\"formats\": [
\"CD\",
\"Cassette\",
\"LP\" ],
\"gold\": true
}
];
formats
array. Additional album records could be added to the top level array.",
"NoteJSON
is a data interchange format used to store data (source: json.org).",
+ "A property is the part of an object that associates a key (either a String value or a Symbol value) and a value (source: ecma-international.org/ecma-262/6.0/#sec-property). So, a property consists of a key - value pair. (source: spacetelescope.github.io/understanding-json-schema/reference/object.html#properties). Property keys (also known as names) should be in quotation marks.",
+ "Like JavaScript Objects, JSON is flexible because it is heterogeneous, meaning it permits Data Structures with arbitrary combinations of strings, booleans, numbers, arrays, and objects.",
+ "Here is an example of a JSON object:",
+ "var ourMusic = [", + "This is an array of objects and the object has various pieces of metadata about an album. It also has a nested
{
\"artist\": \"Daft Punk\",
\"title\": \"Homework\",
\"release_year\": 1997,
\"formats\": [
\"CD\",
\"Cassette\",
\"LP\" ],
\"gold\": true
}
];
formats
array. Additional album records could be added to the top level array.",
+ "NotemyMusic
object. Add artist
and title
strings, release_year
number, and a formats
array of strings."
],
@@ -4503,45 +4510,48 @@
"title": "Record Collection",
"description": [
"You are given an object representing (a small part of) your record collection. Each album is identified by a unique id number and has several properties. Not all albums have complete information.",
+ "You are given a JSON object representing (a small part of) your record collection. Each album is identified by a unique id number (its key) and has several properties. Not all albums have complete information.",
"Write a function which takes an id
, a property (prop
), and a value
.",
"For the given id
in collection
:",
- "If value
is non-blank (value !== \"\"
) and prop
is not \"tracks\"
then update or set the value
for the prop
.",
- "If the prop
is \"tracks\"
and value
is non-blank, push the value
onto the end of the tracks
array.",
- "If \"tracks\"
is non-existent before you update it, create an empty array before pushing a track to it.",
+ "If prop
does not contain the key \"tracks\"
, then update or set the value
for that incomplete prop
.",
+ "If prop
does not contain the key \"tracks\"
before you update it, create an empty array before pushing a track to it.",
+ "If prop
does contain the key \"tracks\"
and its value
is non-blank, then push the value
onto the end of its existing tracks
array.",
"If value
is blank, delete that prop
.",
"Always return the entire collection object.",
- "Notebracket notation
when accessing object properties with variables."
+ "Hintsbracket notation
when accessing object properties with variables.",
+ "Push is an array method you can read about on Mozilla Developer Network.",
+ "You may refer back to Introducing JavaScript Object Notation (JSON) for a refresher."
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
"// Setup",
"var collection = {",
- " 2548: {",
- " album: \"Slippery When Wet\",",
- " artist: \"Bon Jovi\",",
+ " \"2548\": {",
+ " \"album\": \"Slippery When Wet\",",
+ " \"artist\": \"Bon Jovi\",",
" tracks: [ ",
" \"Let It Rock\", ",
" \"You Give Love a Bad Name\" ",
" ]",
" },",
- " 2468: {",
- " album: \"1999\",",
- " artist: \"Prince\",",
- " tracks: [ ",
+ " \"2468\": {",
+ " \"album\": \"1999\",",
+ " \"artist\": \"Prince\",",
+ " \"tracks\": [ ",
" \"1999\", ",
" \"Little Red Corvette\" ",
" ]",
" },",
- " 1245: {",
- " artist: \"Robert Palmer\",",
- " tracks: [ ]",
+ " \"1245\": {",
+ " \"artist\": \"Robert Palmer\",",
+ " \"tracks\": [ ]",
" },",
- " 5439: {",
- " album: \"ABBA Gold\"",
+ " \"5439\": {",
+ " \"album\": \"ABBA Gold\"",
" }",
"};",
"// Keep a copy of the collection for tests",
- "var collectionCopy = JSON.parse(JSON.stringify(collection));",
+ "var collectionCopy = JSON.parse(stringify(collection));",
"",
"// Only change code below this line",
"function updateRecords(id, prop, value) {",