TypeScript for JavaScript Developers Part 5: Scope and Let

Опубликовано: 28 Октябрь 2024
на канале: Jeremy Likness
222
3

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