जॉइन Examsbook
883 0

प्र: What is session storage and how can you create one?

  • उत्तर देखें
  • Workspace

उत्तर :
व्याख्या :

Session storage is same like local storage but the data is valid for a session. In simple words the data is deleted as soon as you close the browser. To create a session storage you need to use “sessionStorage.variablename” . In the below code we have a created a variable called as “clickcount”. If you refresh the browser the count increases. But if you close the browser and start again the “clickcount” variable starts from zero. if(sessionStorage.clickcount) { sessionStorage.clickcount=Number(sessionStorage.clickcount)+1; } else { sessionStorage.clickcount = 0; }

क्या आपको यकीन है

  त्रुटि की रिपोर्ट करें

कृपया संदेश दर्ज करें
त्रुटि रिपोर्ट सफलतापूर्वक जमा हुई