Javascript is a client-side language, you don't have control of the software stack, thus (ideally, if you want to) you have to write code to support every version, even a prehistoric chrome build from 2015 (be it directly or indirectly via transpiling and polyfills).
PHP is not like that, like in every other language where you can control the entire environment, it evolves and things break, and that's the way it should be, that's why we have semantic versioning.