I was wanting to test some things with let
statement in the console, but I ran into a problem - it isn't supported in Firefox or Chromium. I know it's supported, if you set the javascript version in a script tag, but is there any option that will let you make sure the latest version of Javascript is enabled in the web console (or Scratchpad) of Firefox and/or Chromium?
Asked
Active
Viewed 2,725 times
1
-
Firefox already supports it in the Web console. For Chromium, see http://stackoverflow.com/a/17253177/938089. – Rob W Jul 07 '13 at 10:57
3 Answers
2
Works for me in the Firefox console.
Cmd + Shift + K to bring up the console and:

Rob W
- 341,306
- 83
- 791
- 678
-
Interesting. I tried `let x=3 { console.log(x); }` and it doesn't work. – NoBugs Jul 11 '13 at 05:07
-
1
0
I think there's no such thing as a window.version or something like that... the common way is by checking like posted in Detect version of JavaScript
or even better heck out Modernizr, which is a great library that does feature detection for you.

Community
- 1
- 1

Rafael Fontes
- 1,195
- 11
- 19
-
1Thank, but I know it supports JS1.7, the question is, how to use it without making a new script tag in a document, with the `type="application/javascript;version=1.7"` attribute. – NoBugs Jul 06 '13 at 04:46
0
In Chrome you have to activate JavaScript Harmony,"chrome://flags"
and use the strict mode "use strict";
.
Here's a simple example:
"use strict";
let square = "trololo";
console.log(square);

Walter Fuchs
- 167
- 2
- 11