Scope in JavaScript

Scope is set of rules that determines where and how a variable can be referenced or is visible. Because we can nest blocks or functions inside another …