InterviewHubPRO
Section Overview
Q51

Question 51 of 521

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

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

How do you check web storage browser support

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..
}