Freecodecamp: ReferenceError: stringify is not defined

Created on 22 Jun 2016  路  6Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Record Collection has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


// 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"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {


  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");


help wanted bug

All 6 comments

Thanks for reporting. Your code is not correct.
Please consult JavaScript Chat Room.

Thanks and Happy Coding!

hi @raisedadead - the above is the default code.

FYI, the default code should prepend stringify with JSON, like this:

var collectionCopy = JSON.parse(JSON.stringify(collection));

I mention it as anyone newer to coding will have problems not necessarily to do with their own code.

Thanks,

Regards,

Paul.

Hi Paul (@MistaTwist),

Apologies for the closure, I just noticed after you comment the true issue, unfortunately the Opening Post of the thread did not mention that this was the default code, to which I assumed that this is the code you wrote and hence my conclusion.

Looks like this has crept in as a part of a recent merge of PR #9096
Specifically on line :
https://github.com/FreeCodeCamp/FreeCodeCamp/pull/9096/files#diff-5fbffcdf48f7976dd3b0216c387eebc2R4554

Reopening for a fix.

Thanks for reporting.

Additional issues with the challenge:

https://www.freecodecamp.com/challenges/introducing-javascript-object-notation-json results in
image

/cc @atjonathan

@raisedadead the JSON.stringify issue was resolved with #9277. It just needs to be pushed to the live site. Feel free to close this issue unless you want to address the issue you've just mentioned right above.

@raisedadead, this is due to a recent merge by @Bouncey (https://github.com/FreeCodeCamp/FreeCodeCamp/pull/9144). I'm gonna close this issue, as @erictleung is correct, and make another for this problem.

The new issue: https://github.com/FreeCodeCamp/FreeCodeCamp/issues/9293

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MelissaManning picture MelissaManning  路  3Comments

DaphnisM picture DaphnisM  路  3Comments

vaibsharma picture vaibsharma  路  3Comments

Tzahile picture Tzahile  路  3Comments

SaintPeter picture SaintPeter  路  3Comments