js local storage Flashcards
1
Q
How to you store data in localStorage?
A
window.localstorage.setItem(keyName, keyValue)
2
Q
How to you retrieve data from localStorage?
A
window.localstorage.getItem(keyName)
3
Q
What data type can localStorage save in the browser?
A
JSON strings
4
Q
When does the ‘beforeunload’ event fire on the window object?
A
when the window/document are about to be unloaded