Class 1 Flashcards
1
Q
[ {…}, {…}]
A
An array with 2 objects inside of the array
1
Q
What is local storage?
A
Property that allows JS websites and apps to store key-value pairs in a web browser with no expiration date. The stored data will persist even after user closes the browser or restart the computer.
Allows you to store data across browser sessions
2
Q
A
3
Q
How to put item into local storage?
A
localStorage.setItem(“bestFriend”, “Bob”)
4
Q
How to get item out of local storage?
A
localStorage.getItem(“bestFriend’)
5
Q
How to remove item in local storage?
A
localStorage.removeItem(“bestFriend”, “Bob”)
6
Q
How to remove all in local storage?
A
localStorage.clear()
7
Q
How to access localStorage?
A
Right click, inspect, application
8
Q
A