javascript-local-storage Flashcards
1
Q
How do you store data in localStorage?
A
localStorage.setItem() method
2
Q
How do you retrieve data from localStorage?
A
localStorage.getItem() method
3
Q
What data type can localStorage save in the browser?
A
String type data (JSON)
4
Q
When does the ‘beforeunload’ event fire on the window object?
A
When the window, the document, and its resources are about to be unloaded