Which code statement below correctly persists an objects in local Storage?
Which code statement below correctly persists an objects in local Storage?

A . const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}
B . const setLocalStorage = (jsObject) => {window.localStorage.connectObject(jsObject));}
C . const setLocalStorage= (jsObject) => {window.localStorage.setItem(jsObject);}
D . const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}
Answer: A
Latest JavaScript Developer I Practice Questions with 144 Q&As
Updated Study Material | Instant Download | Detailed Answers and Explanations
Subscribe
Login
0 Comments