JavaScript Visualized: Scope (Chain)
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(getPerson...
arsaluddin.hashnode.dev4 min read