6 ms·
Actually, wrapping the code in {} does make a difference with 'let'. A 'let' in braces does not escape the braces.
by elehack 15y ago
Actually, wrapping the code in {} does make a difference with 'let'. A 'let' in braces does not escape the braces.
- jQueryIsAwesome 15y agoWell, the "let" keyword still doesn't work on any major browser so is like it doesn't even exist yet.
- bzbarsky 15y ago"let" has worked in Firefox for years; support for it first shipped in Firefox 2 back in 2006. You do have to opt in to it by putting type="application/javascript;version=1.7" on your script tag, since the feature is not backwards-compatible and hence couldn't be added to existing scripts without possibly breaking them. JS 1.7 in general added a bunch of neat features (array comprehensions, destructuring assignment, etc) that are only now slowly making their way to specifications after some foot-dragging by certain parties. See https://developer.mozilla.org/en/JavaScript/New_in_JavaScript/1.7 https://developer.mozilla.org/en/JavaScript/New_in_JavaScrip...