Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

For clearing all the settings which function should be called?

a) localStorage.remove(key)
b) localStorage.clear()
c) localStorage.remove()
d) localStorage.clearAll()

Answer: b
Explanation: If we want to delete all the setting we can call localStorage.clear() method, localStorage.remove(key) only removes the key of the value that we have given. Same can be applied with sessionStorage also the syntax will be sessionStorage.clear().

Join The Discussion