Tell us what’s happening:
I am trying to access this information in the object but it is not passing in the test. So I’ve got this to work by myself in the web browsers console by using a string name for the track objects instead of the ints that are used in the example and it works, but using numbers for the objects throws: SyntaxError: unexpected token: numeric literal
The challenge doesn’t want me to change that information… am I missing something?
Your code so far
//console work
collection = {
4123:{
artist: "Kele",
song: "I am sad",
album: "Saddness"
}
};
//cofirmation object was created
Object { 4123: {…} }
//run code below
collection.4123.artist;
// ERR: SyntaxError: unexpected token: numeric literal
// Setup
var collection = {
2548: {
album: "Slippery When Wet",
artist: "Bon Jovi",
tracks: [
"Let It Rock",
"You Give Love a Bad Name"
]
},
2468: {
album: "1999",
artist: "Prince",
tracks: [
"1999",
"Little Red Corvette"
]
},
1245: {
artist: "Robert Palmer",
tracks: [ ]
},
5439: {
album: "ABBA Gold"
}
};
// Only change code below this line
function updateRecords(id, prop, value) {
if (prop != "tracks" && value != ""){
collection.id.prop.value = value;
}
return collection;
}
updateRecords(5439, "artist", "ABBA");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0
.
Challenge: Record Collection
Link to the challenge: