News from the Field
A channel with tips on modern AI development. Join!
⊗jsSpSgNA 89 of 294 menu
◀ ▶

Number of entries in a localStorage in JavaScript

Using the length property, you can find out the number of entries stored in the local storage:

let num = localStorage.length; console.log(num);

On button click, display the number of entries in the local storage.

By clicking a button, find out the number of entries in the local storage and, if there are more than 10, clear the storage.

← →
↑
English▼
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline