Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the main difference between localStorage and sessionStorage?

  1. A localStorage persists until cleared and is shared across tabs; sessionStorage is per tab and cleared on close
  2. B sessionStorage holds more data
  3. C localStorage is sent with every HTTP request
  4. D There is no difference
Answer

localStorage persists until cleared and is shared across tabs; sessionStorage is per tab and cleared on close

Both hold roughly 5-10MB of string data and neither is sent to the server. Only the lifetime and scope differ.

All Javascript MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as