Skip to main content
InterviewHubPRO
Section Overview
Q51

Question 51 of 536

Part 1: Core Objects, Prototypes, Functions & Scope (1 - 53)

10%
JavaScript & V8 Internals (536 Qs)•Part 1: Core Objects, Prototypes, Functions & Scope (1 - 53)

How do you check web storage browser support

mid LevelMost AskedCode ExamplePrototypes

You need to check browser support for localStorage and sessionStorage before using web storage,

javascript
if (typeof Storage !== "undefined") {
  // Code for localStorage/sessionStorage.
} else {
  // Sorry! No Web Storage support..
}