March 2023
Beginner
441 pages
5h 1m
English
When we declare a variable, its name is valid only inside some sections of the source code. And that section (part, portion, region) of the source code is called scope. It is the region of code in which the name can be accessed. There are different scopes.
When we declare a name inside a function, that name has a local scope. Its scope starts from the point of declaration till the end of the function block marked with }.