Record Collection - what to they mean 'should not be set'? I have ignored this and left as is, I have also set the value to "" neither passes

Tell us what’s happening:

Your code so far

// 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": [ 
        "Little Red Corvette" 
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    "5439": {
      "album": "ABBA Gold"
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
  if (value === '') {
    console.log ("Nothing was set");
    collection[id][prop] = undefined;
    return collection;

  else  if (prop === 'tracks' && collection[id].hasOwnProperty(prop) === false) {
    console.log("this hit test of has property - " + collection[id].hasOwnProperty('prop') + " prop "+ prop);
    collection[id][prop] = [];
    collection[id][prop] = [value];
    return collection;

  else if (prop === 'tracks' && collection[id].hasOwnProperty(prop) === true) {
    console.log(" Push THIS!!! ")
    return collection;
  collection[id][prop] = value;
  return collection; 
// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:

“Should not be set” means that it should not have anything assigned to it. You left off the “tell us what’s happening” section, so I can’t tell exactly what problem you’re experiencing. If this relates to the first if block though, you are setting collection[id][prop] to undefined.

got it, “should not be set” = delete this property and value


The only time you should delete a property/value is if value = ‘’.

Your function’s 2nd to last line is:

collection[id][prop] = value;

This line will always set the specific collection object’s property to value. This is causing a related problem, because you are setting properties even if the value is a blank string.