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

I'd argue that if you're doing this you can't have tested your JavaScript on many platforms. This breaks very quickly in my experience. Feature detection[1] is a much better strategy. That can get complicated too, but often there are third-party polyfills that can do that for you.

[1] https://developer.mozilla.org/en-US/docs/Learn/Tools_and_tes...

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