Back to the lesson

Turn the object into JSON and back

importance: 5

Turn the user into JSON and then read it back into another variable.

let user = {
  name: "John Smith",
  age: 35
};
let user = {
  name: "John Smith",
  age: 35
};

let user2 = JSON.parse(JSON.stringify(user));