Skip to content

Commit 1c70a0e

Browse files
authored
Update 100_JS_Que
1 parent dc9fc23 commit 1c70a0e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

100Questions/100_JS_Que

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,8 @@ const user = {
683683
console.log(JSON.stringify(user)) //convert into a string
684684
console.log(JSON.parse(JSON.stringify(user))) //convert into an object
685685

686-
localStorage.setItem("testAsKey", JSON.stringify(user))
686+
localStorage.setItem("testAsKey", JSON.stringify(user)) {"name":"priya","age":100}
687+
localStorage.setItem("testAsKey", user) //[object Object] beacuse we are forcefully trying to convert in a string
687688
------------------------------------------------------------------------------------------
688689

689690

0 commit comments

Comments
 (0)