admin管理员组

文章数量:1315376

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.)

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.)

Share Improve this question edited Oct 28, 2015 at 18:11 Deduplicator 45.7k7 gold badges72 silver badges123 bronze badges asked Apr 30, 2012 at 18:14 user420667user420667 6,71015 gold badges54 silver badges84 bronze badges 8
  • 2 If your bowser doesn't support it, it won't work in JSFiddle either. Can you a link a fiddle where it does "work"? – Alex Wayne Commented Apr 30, 2012 at 18:18
  • @EliranMalka: developer.mozilla/en/New_in_JavaScript_1.7#let_statement – Evert Commented Apr 30, 2012 at 18:21
  • @Alex Wayne: Not sure why I'd thought I'd tested it. – user420667 Commented Apr 30, 2012 at 18:24
  • seriously when will they stop adding useless features to javascript – mihai Commented Apr 30, 2012 at 18:24
  • 1 @mihai: what makes you say it's useless? – user420667 Commented Apr 30, 2012 at 18:24
 |  Show 3 more ments

2 Answers 2

Reset to default 6

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"/>

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

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

本文标签: javascript let not working in various browsersStack Overflow