JSON example confusing me - about JSON.parse, JSON.stringify, localStorage.setItem and localStorage.getItem
问题 I'm just starting to learn JSON and W3schools isn't very good at explaining what each line does. I can sort of figure out what some of them mean, but I'd like to figure it out completely. // Storing data: 1. myObj = {name: "John", age: 31, city: "New York"}; 2. myJSON = JSON.stringify(myObj); 3. localStorage.setItem("testJSON", myJSON); // Retrieving data: 4. text = localStorage.getItem("testJSON"); 5. obj = JSON.parse(text); 6. document.getElementById("demo").innerHTML = obj.name; So I know