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

String.prototype.endsWith is native [0], it was added as part of ES2015. If you're supporting older platforms, you need to polyfill it.

[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...



How well supported is ES6 across browsers? Chrome for sure. Not sure about FF or IE.


The support is quite good today, see https://kangax.github.io/compat-table/es6/.


You can transpile to ES5 if you've got compatibility issues. Not really a problem.


Transpiling usually concerns syntax. Babel won't transpile .endsWith to a polyfill for you, hence the existence of that package




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

Search: