Arshad Mehmood

Search the blog

    Local Storage

    javascript1 min read

    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);