DEV Community

Discussion on: String startsWith() Method in JavaScript

Collapse
 
prahladyeri profile image
Prahlad Yeri • Edited

I can understand all the excitement about these new ways but folks, remember that many enterprise users are still stuck on older versions of IE and Windows 7. On the server side, there are many who haven't migrated from Ubuntu 12.04/14.04 LTS versions and those old versions of node don't yet support the startsWith & endsWith fancy methods and you still have to deal with the old indexOf!

As a dev, you should ideally know both but if you are limited on brain resources, the advantage of using indexOf is that it works on both old and new versions of JS. Especially if you still happen to support enterprise users, the knowledge of the old ways still helps! There will be a time for upgrading to these newer methods, but that time still hasn't come yet.

Collapse
 
ssimontis profile image
Scott Simontis

Polyfills to the rescue! I'd rather have all the abstractions out there available to my team so that they can use what works best for them than limit them to support customers using legacy technology. I have no problem pushing a larger paload or slower performance on legacy users for my software; I think it helps incentivize change. A lot of times when someone comes to me with an IE10 bug or something similar, it would be cheaper to buy that person an Intel Atom PC than it is to pay a programmer to diagnose, fix, and test the issue.

Collapse
 
samanthaming profile image
Samantha Ming

Totally, you should not dismiss supporting old browser. There are a lot of folks especially in the public section using IE or older browser. I think that’s where polyfill or something like Babel come into play 👍 it doesn’t deprive the better dev experience of using the newer syntax and still give you support of older browsers 🙂