ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 90 - Certified JavaScript Developer I discussion

Report
Export

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

A.
const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}
Answers
A.
const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}
B.
const setLocalStorage = ( jsObject) => {window.localStorage.connectObject(jsObject));}
Answers
B.
const setLocalStorage = ( jsObject) => {window.localStorage.connectObject(jsObject));}
C.
const setLocalStorage = ( jsObject) => {window.localStorage.setItem(jsObject);}
Answers
C.
const setLocalStorage = ( jsObject) => {window.localStorage.setItem(jsObject);}
D.
const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}
Answers
D.
const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}
Suggested answer: A
asked 23/09/2024
Martin Gucký
51 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first