TypeScript for JavaScript Developers Part 5: Scope and Let
Channel: Jeremy Likness
Date: 27/02/2019

A bug has surfaced due to the way variables are captured in scope in JavaScript. Rather than wrap the call in additional code that adds complexity, a simple change is to specify the variable with "let". The TypeScript compiler then knows to manage scope for older version of JavaScript, and passes through to modern implementations.

Learn more about "let" declarations: https://jlik.me/ffm