Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Except when a value has already been stored previously without JSON.stringify (in which case JSON.parse will throw), or you need a default value if unset (e.g `store.get('username', 'anonymous')`, or ... :) But I also see your point that sometimes the very quick and simple solution can be useful!


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: