ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 62 - Certified JavaScript Developer I discussion

Report
Export

Which code statement correctly retrieves and returns an object from localStorage?

A.
const retrieveFromLocalStorage = () =>{return JSON.stringify(window.localStorage.getItem(storageKey));}
Answers
A.
const retrieveFromLocalStorage = () =>{return JSON.stringify(window.localStorage.getItem(storageKey));}
B.
const retrieveFromLocalStorage = (storageKey) =>{return window.localStorage.getItem(storageKey);}
Answers
B.
const retrieveFromLocalStorage = (storageKey) =>{return window.localStorage.getItem(storageKey);}
C.
const retrieveFromLocalStorage = (storageKey) =>{return JSON.parse(window.localStorage.getItem(storageKey));}
Answers
C.
const retrieveFromLocalStorage = (storageKey) =>{return JSON.parse(window.localStorage.getItem(storageKey));}
D.
const retrieveFromLocalStorage = (storageKey) =>{return window.localStorage[storageKey];}
Answers
D.
const retrieveFromLocalStorage = (storageKey) =>{return window.localStorage[storageKey];}
Suggested answer: C
asked 23/09/2024
Garvey Butler
44 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first