TypeScript Scope is JavaScript Scope

This lesson discusses the principle of shadowing, capturing, and declaring a variable in JavaScript and naturally porting to TypeScript.

Shadowing scope

We briefly encountered the concept of scope when exploring the three declaration types discussed in the previous lessons. You saw that a variable declared using var has a broader than, let, and const. However, there are some other cases involving the scope with let and const.

Get hands-on with 1200+ tech skills courses.