JS local storage Flashcards
1
Q
How do you store data in localStorage?
A
.setItem method
2
Q
How to you retrieve data from localStorage?
A
.getItem method
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
when tab is closed, or browser refreshed causes ‘beforeunload’ event to fire