Works for me in the Firefox console.
Cmd + Shift + K to bring up the console and:
Вопрос
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?
Решение
Works for me in the Firefox console.
Cmd + Shift + K to bring up the console and:
Другие советы
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.
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);