Google Chrome - JavaScript Version

What version of JavaScript does Google Chrome support regarding Mozilla Firefox? In other words, does Chrome support JavaScript 1.6, 1.7, or 1.8 that Firefox supports, or some combination of them?

+45
javascript firefox google-chrome
Nov 18 '08 at 21:22
source share
6 answers

While Chrome runs Javascript marked as "javascript1.7", it does not support JS1.7 functions, such as the "let" variable statement with restrictions.

This code will work on Firefox 3.5, but not on Chrome using V8:

<script language="javascript" type="application/javascript;version=1.7"> function foo(){ let a = 4; alert(a); }; foo(); </script> 

If you change the language to "javascript1.7" and omit this type, it will not work with JS 1.7 functions in Firefox 3.5. A type section is needed.

This seems like a common WebKit error, https://bugs.webkit.org/show_bug.cgi?id=23097 ; it may be that Chrome emulates the behavior of Safari, even if it uses a different engine.

When asked about support for JS 1.8 features , the V8 team said it was trying to keep track of the version used by Safari, so the pages would act the same in both browsers.

+41
Jul 14 '09 at 13:24
source share

This topic is still relevant. Since 2012, Chrome has supported most Javascript 1.6, not including line and array generators. It does not support any of 1.7. It supports the reduction and reduction of rights from 1.8, all 1.8.1, as well as Getters and seters and all non-version-specific things listed on this page . This page is linked to the Mozilla Developer Network, which lists the javascript versions found here .

+17
Mar 14 2018-12-12T00:
source share

Google Chrome uses the V8 javascript engine , which currently claims to be implementing ECMA-262, 3rd edition. This would mean that it supports at least version 1.5.

+12
Nov 18 '08 at 21:46
source share

Here's a simple Javascript 1.6 Chrome function (and V8 users like node.js) will not execute: for each ... in

 for each (variable in object) statement 

Like JS 1.5 (for every answer from J c), this is the only version Chrome claims to be fully implemented.

In fact, the Chrome team is mainly focused on compatibility with Safari (the most famous Webkit user at that time) and abandoned these features.

+10
Jan 08 2018-10-10T00:
source share

Google Chrome supports up to Javascript 1.7:

 <script language="javascript1.7">alert(1.7);</script> - Alerts <script language="javascript1.8">alert(1.8);</script> - Doesn't alert 
+5
Nov 18 '08 at 21:41
source share

This is an old thread, however it goes here. Google Chrome does not respond to the following

 function foo(){ let a = 4; alert(a); } foo(); 

therefore, it does not support JavaScript 1.7

+4
Apr 13 2018-11-21T00:
source share



All Articles