Posts

Showing posts with the label local scope

Learn JavaScript : Global and Local Scope (Part 3)

Image
Introduction The concept of "Scope" in computer programming, can be understood in terms of the accessibility of data. In simple terms let's consider this scenario; As a Coder, consider that you code in blocks of code and that anytime you create a function or a variable outside a block of code like a function or class, it is called a global scope and when you define and declare variables and functions within a function or a class or any block of code it is called a local scope .  Kindly study the following Parts in case you had skipped them. JavaScript Introduction JavaScript Variables Now, consider the global scope and local scope as contextual. Meaning data created in a global scope is different from data created in a local scope. But in a programming setting, data created in a global scope is mostly accessible in a local scope context or block. How scopes behave may be different in other programming languages. Especially with the process of how data in a loc...

followers