Al Hobbs wrote:The browser will use whatever js it has. You aren't going to run any ES6 on internet explorer no matter what you put in the tag
Do you mean the browser will auto use the latest javascript version when it interpret a javascript file ? so if the current latest version is ES10, even it is a dummy alert("hello") browser still uses ES10 to interpret this simple statement ?
No, uses whatever it has to interpret the JS file. Some browsers might not even implement certain parts of the standard. That's why the mozilla docs show what browsers support that particular aspect of the language being documented.
Like if you write a python3 script but your computer has python2 it's not going to work. Whatever the browser has is what is used.
Correct, the browser applies whatever JS support it has equally to all script. It doesn't evaluate a script for how simple it is and use different versions based upon that.
Most modern browsers will support ES6 syntax pretty much completely. Be aware that browsers take some time to catch up to latest specs.
The "Can I use" site is useful for figuring out what supports what.