0

Is it possible to detect which javascript version the browser currently is using.

I want to know if it is Ecmascript 4/5/6

Is it possible by using the console??

samayo
  • 16,163
  • 12
  • 91
  • 106
wilsonrufus
  • 449
  • 1
  • 5
  • 14
  • Also, take a look at [Detecting version of JavaScript within browser](http://stackoverflow.com/q/7340726/851811) – Xavi López Jan 23 '13 at 13:39
  • 2
    Test for features, not versions. – bfavaretto Jan 23 '13 at 13:41
  • sorry for the late reply i wanted to know if it is possible using console i know the earlier SCRIPT LANGUAGE="JavaScript1.1" just wanted to know if there is any other way by which the browser shows that it support ES6 Is there any browser inbuilt function??maybe specific for firefox me not asking for all browser – wilsonrufus Jan 23 '13 at 16:21

1 Answers1

1

You can use the language attribute to detect the version of JavaScript.

<SCRIPT LANGUAGE="JavaScript1.1">
// do something on with browsers that use Javascript 1.1
</SCRIPT>

However for detecting what functions are available you are better to detect the individual features available, as browser don't always implement everything in the ECMAScript version.

Modenizer is a well used library for doing this.

Peter Campbell
  • 661
  • 1
  • 7
  • 35