Scope: It is a region of the program where a variable can be accessed. In other words, scope determines the accessibility/visibility of a variable.
Local Scope: variables declared inside the functions are considered to be of the local scope and it is further divided into function scoped and block scoped.
Function scope is within the function. Block scope is within curly brackets.
Function Scope: When a variable is declared inside a function, it is only accessible within that function and cannot be used outside that function.
Block Scope: A variable when declared inside the if/else conditions or inside for or while loops, are accessible within that particular condition or loop.