JavaScript-local-storage Flashcards
1
Q
How do you store data in localStorage?
A
setItem()
2
Q
How do you retrieve data from localStorage?
A
getItem()
3
Q
What data type can localStorage save in the browser?
A
JSON
4
Q
When does the ‘beforeunload’ event fire on the window object?
A
Before someone is about to exit the window but there is some condition like a form that’s not filled out. When it’s about to be unloaded.