javascript-local-storage Flashcards
1
Q
How do you store data in localStorage?
A
localStorage.setItem(‘key name’)
2
Q
How do you retrieve data from localStorage?
A
localStorage.getItem(‘key name’)
3
Q
What data type can localStorage save in the browser?
A
strings
4
Q
When does the ‘beforeunload’ event fire on the window object?
A
right before the tab is about to unload (close tab, close window, anything that would cause you tab to load, etc)