You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That being said, blocks haven’t been very useful before due to lack of block scope, but that’s not different than the earlier discussion of let and const
Blocks don’t really do the same thing as IIFEs in enough situations to call then replacements I think. They will not limit var declarations, but more importantly they won't limit function declarations which will be hoisted into a higher scope
The text was updated successfully, but these errors were encountered:
You're absolutely right. Blocks don't cover all the situations to replace IIFEs, but they should be considered first. Maybe I can update the example to better reflect this - I'll think about a good way to phrase it.
Blocks have been in js for a long time - they’re the reason
breaks since it is interpreted as
That being said, blocks haven’t been very useful before due to lack of block scope, but that’s not different than the earlier discussion of
let
andconst
Blocks don’t really do the same thing as IIFEs in enough situations to call then replacements I think. They will not limit
var
declarations, but more importantly they won't limitfunction
declarations which will be hoisted into a higher scopeThe text was updated successfully, but these errors were encountered: