How to check the JavaScript version

JavaScript is a client-side programming language. This means it is running on the user’s browser. It is very well supported and interpreted by the most used browsers like Chrome, Firefox, Safari, Internet Explorer, Edge, Opera, and many more.

The Brendan Eich initial programming language was first named Mocha and then changed the name to LiveScript, and finally JavaScript. Several editions of the language standard have been published since then.

What is ECMAScript?

The name ECMAScript was a compromise between the organizations involved in standardizing the language. There are nine editions of ECMAScript published. The last ECMA version was published in June 2018.

Javascript and others like JScript and ActionScript are all different implementations of ECMAScript. If you want to further read about differences between them there is an interesting debate at the StackOverflow website here: https://stackoverflow.com/questions/912479/what-is-the-difference-between-javascript-and-ecmascript/33748400#33748400

Ecma script descendens

How many Javascript versions are available

For now, there are 12 different versions of Javascript. The Javascript version 1.4 was intended to work only on Netscape so it is not included in the table below.

JavaScript Version Released ECMA Equivalent Firefox IE Chrome
1.0 March 1996 3.0
1.1 August 1996
1.2 June 1997
1.3 October 1998 ECMAScript 1 & 2 4.0
1.5 November 2000 ECMAScript 3 1.0 5.5-8.0 1.0-10.0.666
1.6 November 2005 ECMAScript for XML 1.5
1.7 October 2006 2.0
1.8 June 2008 3.0
1.8.1 June 2009 3.5
1.8.2 January 2010 3.6
1.8.5 March 2011 ECMAScript 5 4 9, 10 13.0+

How to check Javascript version in the browser

To get the Javascript version that your browser is using, just set a variable and then try to overwrite it in the next script where you set a language-specific version. Here is how you do it.

<script type="text/javascript">
	var version = 1.0;
</script>

<script language="Javascript1.1"> version = 1.1; </script>
<script language="Javascript1.2"> version = 1.2; </script>
<script language="Javascript1.3"> version = 1.3; </script>
<script language="Javascript1.4"> version = 1.4; </script>
<script language="Javascript1.5"> version = 1.5; </script>
<script language="Javascript1.6"> version = 1.6; </script>
<script language="Javascript1.7"> version = 1.7; </script>
<script language="Javascript1.8"> version = 1.8; </script>
<script language="Javascript1.9"> version = 1.9; </script>

<script type="text/javascript">
  alert(version);
</script>

This will throw an alert with the version your browser is using. You can also check it here on CodePen: https://codepen.io/catalin586/pen/jebKEM