Browsers don't give any real version, because they don't exactly support any one version. They support some (or most) features of some versions.
Any support declared for "JavaScript 1.x" is just a legacy hack for compatibility with Netscape.
Similarly, these navigator
fields are useless on purpose. In the past they have been misused to block browsers so much, that the spec now recommends all browsers to lie and say they are Netscape 4.0.
On the web, in general, you should never check version of anything to decide whether it supports the features you need, because it's too easy to make an invalid assumption and break your code in some browser, including future ones you can't test now (e.g. a feature may not be related to the version you assume, or browsers may lie about versions they support in order to work around sites blocking them).
You should use feature detection instead.
You can detect presence of individual JavaScript features by running them and seeing if they work. If the new feature requires a new syntax, you can try running that syntax inside eval
. See how it's done on: https://kangax.github.io/compat-table/es6/ (there's a (c)
icon with detection code next to features when you expand the list).