I have a question about Javascript. I have gathered information saying that the version of Javascript being used in each browser is dependant on the actual browser.
Can someone please give me a quick list of the version of Javascript in Chrome, Firefox and IE? I have had a look online, but need a definitive answer.
3 Answers 3
You should never need to know the version of JavaScript being run, for the same reason as you should never need to know what browser (or version thereof) is being used to view your site.
For instance, I've seen many sites say "querySelectorAll isn't supported by IE7, but you can hack it with this clever CSS"... but that still doesn't give querySelectorAll support in the many mobile devices that don't support it (the Nintendo DSi browser springs painfully to mind).
Always, always use feature-detection to see if the browser supports a particular feature. For instance,
if( !window.JSON) { /* implement your own JSON-handling functions here */}.
Comments
You are correct in saying that the version of the JavaScript engine is determine by the browser, however, I have no idea why you would need to know this information.
A quick google returned this possible solution
Comments
If you really want to know which versions are used by browser JS engines, you can explore that information on Wikipedia here under the "JavaScript engines" and "Implementations" sections and see if that satisfies what you want to know. I hope this is more of an academic interest though, because as others have mentioned it is far better to check for the particular feature(s) you want to use rather than make assumptions based on browser version.
Comments
Explore related questions
See similar questions with these tags.
<script>s, even though it doesn't support many features of 1.7.