Random Flashcards

1
Q

What is local storage?

A

Local Storage is an API. It is a property that allows you to store data across browser sessions; you can leave the browser and come back and the data will still be there for you to continue working.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is session storage?

A

sessionStorage is similar to localStorage ; the difference is that while data in localStorage doesn’t expire, data in sessionStorage is cleared when the page session ends.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

With localStorage, what are the big 4 methods?

A
  1. Put item into local storage
    localStorage.setItem(“bestFriend”, “Bob”)
  2. Get item out of local storage
    localStorage.getItem(“bestFriend”, “Bob”)
  3. Remove item in local storage
    localStorage.removeItem(“bestFriend”, “Bob”)
  4. Remove all from local storage
    localStorage.clear()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some practice uses of localStorage?

A

When a user is filling out a long form, keep the data in localStorage so that in case user accidentally exited out, we still have the data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly