Answers for "how to know memory used in localstorage javascript"

0

how to know memory used in localstorage javascript

var _lsTotal=0,_xLen,_x;for(_x in localStorage){ if(!localStorage.hasOwnProperty(_x)){continue;} _xLen= ((localStorage[_x].length + _x.length)* 2);_lsTotal+=_xLen; console.log(_x.substr(0,50)+" = "+ (_xLen/1024).toFixed(2)+" KB")};console.log("Total = " + (_lsTotal / 1024).toFixed(2) + " KB");
Posted by: Guest on June-23-2021

Code answers related to "how to know memory used in localstorage javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language