Arshad Mehmood

Search the blog

    Today I Learned

    Local Storage

    javascript

    Browsers store variables in the local storage as strings, so you have to parse them into JSON or use strings.

    //to get
    let myVar = window.localStorage.getItem('myVar');
    
    //to set
    window.localStorage.setItem("myVar", myVar);