Why is JSON not working?
Does anyone no why when I use JSON.parse(JSON.stringify(gun)) it is doing nothing?
var gun = {type: "gun"}
var player1 = JSON.parse(JSON.stringify(gun));
println(player1); // It returns undefined instead of [object Object];
I tried reloading the page and restarting but it wouldn't work. By the way I am using this in the Programming Js Khan Academy Editor.
Please sign in to leave a comment.