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

Another way to store booleans that can be worth mentioning is to add (or not) a parameter in the url without a value.

To reuse the example from https://antonz.org/storing-state/#boolean-value

{"search": "potatoes", "popular": true} can be serialized as ?search=potatoes&popular



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: