Variable c is still accessible, d is the one that is not accessible anymore.

pull/380/head
Ulaş Can Zorer 1 year ago
parent 8b41cd49c3
commit 96ab8a2f55

@ -1672,7 +1672,7 @@ function letsLearnScope() {
let d = 40
console.log(a, b, c) // Python 20 30
}
// we can not access c because c's scope is only the if block
// we can not access d because d's scope is only the if block
console.log(a, b) // JavaScript 10
}
letsLearnScope()

Loading…
Cancel
Save