0

let doesnt't work in some browsers. Not in their interpeters/ web consoles either. Why?

(originally I thought there was an inconsistency b/t the browser interpeter and the jsFiddle, but it turns out not to be true, just bad tests on my part.)

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
user420667
  • 6,552
  • 15
  • 51
  • 83

2 Answers2

5

In order to use some of the new features of JavaScript 1.7, you need to specify that you wish to use JavaScript 1.7. In HTML or XUL code, use

<script type="application/javascript;version=1.7"/>
suhair
  • 10,895
  • 11
  • 52
  • 63
3

It is a non-standard keyword introduced in JS 1.7, not necessarily implemented in different browsers.

https://developer.mozilla.org/en/JavaScript/Reference/Statements/let

Evert
  • 93,428
  • 18
  • 118
  • 189
Evan Davis
  • 35,493
  • 6
  • 50
  • 57
  • 2
    Only implemented in Gecko, from what I understand. What Mozilla calls 'Javascript 1.7' has nothing to do with 'Ecmascript' which is what everybody implements. – Evert Apr 30 '12 at 18:22