Time for the scope chain 🕺🏼 In this post I assume you know the basics of execution contexts: I’ll soon write a post on that too though 😃 Let's take a look at the following code: const name = "Lydia" const age = 21 const city = "San Francisco" function getPersonInfo() { const name = "Sarah" const age = 22 return `${name} is ${age} and lives in ${city}` } console.log(getPersonInfo()) We're invoki
![⚡️⛓JavaScript Visualized: Scope (Chain)](https://cdn-ak-scissors.b.st-hatena.com/image/square/05e750e569fb039c13d23c732cd36faac2470a72/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fpracticaldev%2Fimage%2Ffetch%2Fs--vlpBaYi9--%2Fc_imagga_scale%2Cf_auto%2Cfl_progressive%2Ch_500%2Cq_66%2Cw_1000%2Fhttps%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fi4jymvdb2vqc4m2wg5jm.gif)