Performance concern with let/const

Brendan Eich brendan at
Mon Sep 17 09:24:58 PDT 2012

Agree with your points in reply to Luke, one clarification here:

Allen Wirfs-Brock wrote:
> As stated above, let isn't the motivator for TDZ, it's const.   Let could easily be redefined to not need a TDZ (if that really proved to be a major area of concern).  So, you either need to argument against const or argue against block scoping, in general rather let.

TC39 has been divided on this but managed to reach TDZ consensus. 
Waldemar argued explicitly for TDZ for let, as (a) future-proofing for 
guards; (b) to enable let/const refactoring without surprises.

One could argue that (a) can be deferred to let-with-guards, should we 
add guards. (b) I find more compelling.


More information about the es-discuss mailing list