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

two things about the `null` - the "replacer" function

1. in IE 8, it will choke. it needs to be a function (hopefully you don't have to care about IE 8, though)

2. in all other JSON.strigifable browsers, you can skip it with a falsey value, which is what the `null` is doing here. As a result, you can also use `0` (e.g. stringinfy(foo, 0, 2)), which I like because I can type it faster




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: