-
For clearing all the settings which function should be called?
-
- localStorage.clearAll()
- localStorage.remove()
- localStorage.remove(key)
- localStorage.clear()
- None of these
Correct Option: D
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().