简体   繁体   中英

javascript let not working in various browsers

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

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.org/en/JavaScript/Reference/Statements/let

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM