I was reading an article by Derick Bailey Don’t Return A JSON Document From The toJSON Method
I was trying to convert the following JSON object into Javascript:
var userJSON = "{\"firstName\":\"Derick\",\"lastName\":\"Bailey\"}";
var parseOnce = JSON.parse(userJSON.to_json).first;
var userObject = JSON.parse(parseOnce.to_json).first;
When I run the code I get a "SyntaxError: Unexpected token u"
Here is a jsbin of the same code https://jsbin.com/zugojoyaro/edit?js,console