0

I'm trying to understand why this is happening.

In created() of my Vue component, if I console.log a localStorage item directly I get the correct result.

console.log(JSON.parse(localStorage.getItem("currentRoom"))); // correct object

But if I assign the localStorage item to a local variable and console that I get sadness. Why?

this.currentRoom = JSON.parse(localStorage.getItem("currentRoom"));
console.log(this.currentRoom); // {__ob__: Observer}
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.