Hacker News new | past | comments | ask | show | jobs | submit login

Here is 90% of all the wrapping you'll ever need over localStorage:

    function ls_get(k) {
        JSON.parse(localStorage.getItem(k))
    }

    function ls_set(k, v) {
        localStorage.setItem(k, JSON.stringify(v))
    }



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: