You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Q132. How would you add a data item named animal with a value of sloth to local storage for the current domain?
LocalStorage.setItem("animal","sloth");
document.localStorage.setItem("animal","sloth");
localStorage.setItem({animal:"sloth"});
localStorage.setItem("animal","sloth");
Incorrectly marked 2nd option as correct answer, but it should be the 4th option.
The 2nd option (document.localStorage) is undefined -- instead the correct usage is window.localStorage or globalThis.localStorage or just localStorage.
The text was updated successfully, but these errors were encountered:
DarrenSem
changed the title
JavaScript - mistake in Q129 (wrong answer)
JavaScript - mistake in Q132 (wrong answer)
Nov 8, 2023
I'm submitting an ISSUE: please check one with "x"
Wrong answer in JavaScript quiz:
https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes/blob/main/javascript/javascript-quiz.md?plain=1#L1854
Q132. How would you add a data item named animal with a value of sloth to local storage for the current domain?
LocalStorage.setItem("animal","sloth");
document.localStorage.setItem("animal","sloth");
localStorage.setItem({animal:"sloth"});
localStorage.setItem("animal","sloth");
Incorrectly marked 2nd option as correct answer, but it should be the 4th option.
The 2nd option (
document.localStorage
) is undefined -- instead the correct usage iswindow.localStorage
orglobalThis.localStorage
or justlocalStorage
.The text was updated successfully, but these errors were encountered: