I was trying to understand the lexical scoping. I gone through here and I found all examples are related to nested functions. Is lexical scope only related to nested functions and parent to child accessibility?
Are there any examples of lexical scoping in js other than nested functions and closures?
AND
Does function parameters also form lexical scoping? For example:
function greet(name) {
console.log("Hello, " + name + "!");
}
greet("Alice"); // Output: "Hello, Alice!"
greet("Bob"); // Output: "Hello, Bob!"