Take the 2-minute tour ×

Which version of JavaScript does Google Chrome support in relation to Mozilla Firefox? In other words, does Chrome support JavaScript 1.6, 1.7, or 1.8 which Firefox also supports or some combination of them?

share|improve this question
As a sidebar, the language attribute of the script tag has been deprecated since the html 4 spec, it's recommended to use type attribute instead. –  seanb Nov 18 '08 at 22:01
This is really weird, my plugin's js have issues with chrome, but working perfectly on other browsers. onclick() not working in select-box. i tried onchange(), onblur() , onfocus() but still not working in chrome. –  Frank Oct 2 '12 at 8:39

6 Answers 6

up vote 40 down vote accepted

While Chrome will execute Javascript marked as "javascript1.7", it does not support JS1.7 features like the "let" scoped variable operator.

This code will run 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();

If you change language to "javascript1.7" and omit the type, it won't run with JS 1.7 features in Firefox 3.5. The type section is necessary.

This seems to be related to a general WebKit bug, https://bugs.webkit.org/show_bug.cgi?id=23097; it may be that Chrome emulates the Safari behavior even though it uses a different engine.

When asked about supporting JS 1.8 features, the V8 team said they were trying to track the version used in Safari so pages would act the same in both browsers.

share|improve this answer
thanks so much! –  gatoatigrado Dec 27 '09 at 1:29
That one with let is annoying. I'm forced to use nested closures instead: developer.mozilla.org/en/Core_JavaScript_1.5_Guide/… –  Tobu Mar 16 '10 at 21:39

This thread is still relevant. As of 2012, Chrome supports most of Javascript 1.6, not including string and array generics. It supports none of 1.7. It supports reduce and reduceRight from 1.8, all of 1.8.1, and Getters and setters and all the non-version specific things listed on this page. This page is linked from the Mozilla Developer Network, which specifies the versions of javascript, found here.

share|improve this answer

Google Chrome uses the V8 javascript engine, which currently states that it implements ECMA-262, 3rd edition. This would imply it supports at least version 1.5.

share|improve this answer
Strange. I thought the for(var i in objects) iterator was something not in the third edition, yet it works fine in Chrome and Safari. –  skerit Jul 19 '10 at 12:25
@skerit by saying "it implements", at least all of the features in ECMA-262 v3 is available. They are free to add other features, including the one you mentioned. –  syockit Jun 2 '11 at 20:08

Here's a simple Javascript 1.6 feature Chrome (and V8 users, like node.js) won't run: for each … in

for each (variable in object)

As it is JS 1.5 (per J c's answer) is the only version Chrome claims to completely implement.

In fact the Chrome team has mostly aimed for compatibility with Safari (most prominent Webkit user at the time), and refused features on those grounds.

share|improve this answer
Very good point. –  CDR Jan 15 '10 at 6:53
Not supported in Chrome 16.0. Wasted an hour wondering why code was not working... –  SabreWolfy Feb 7 '12 at 15:12
You're not using forEach correctly. Check the syntax here: robertnyman.com/javascript/javascript-1.6.html –  Case Mar 14 '12 at 3:39
@Sharon that's a different feature. My answer is framed by the question; I picked a JS 1.6 feature that is missing in Chrome. Link if you missed it: developer.mozilla.org/en/JavaScript/Reference/Statements/… –  Tobu Mar 14 '12 at 22:05
This doesn't quite answer the question. –  Dan Dascalescu Nov 7 '12 at 5:04

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
share|improve this answer
This sounds like the kind of thing that will change over time- are we sure Chrome wont' support 1.8 by the time it leaves beta? But upvote for showing how to check for yourself. –  Joel Coehoorn Nov 18 '08 at 21:44
@joel: That's too funny. Have you ever seen a google product leave beta? –  NotMe Nov 18 '08 at 21:45
Greg, your test isn't sufficient. Chrome/V8 will run the code in the javascript1.7 section, but it didn't actually test JS 1.7 language features. Those aren't supported in Chrome/V8. –  Ben Combee Jul 14 '09 at 13:27
I will point out that my current version of chrome still doesn't support things like Iterator or the yield keyword –  George Mauer May 17 '11 at 19:21
This answer is not correct. Although V8 will run code in a javascript1.7 tag, it DOES NOT include any 1.7 specific features as of yet. –  GAgnew May 25 '11 at 20:29

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

function foo(){
  let a = 4;

hence it does not support JavaScript 1.7

share|improve this answer
there's a couple of other things i had trouble with in javascript 1.7 on chrome, like even accessing global variables and such –  user151496 Oct 27 '14 at 10:07

Your Answer


