From 45c88da6436dc0a68afcd7258e98a39575c5c042 Mon Sep 17 00:00:00 2001 From: Selva Muthu Kumaran <86711942+selvamuthukumaran1@users.noreply.github.com> Date: Tue, 12 Sep 2023 21:04:32 +0530 Subject: [PATCH] Add information about local scope (#4420) javascript-roadmap-scope-variable-local scope description added fixes : #4388 --- .../content/101-javascript-variables/103-scopes/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data/roadmaps/javascript/content/101-javascript-variables/103-scopes/index.md b/src/data/roadmaps/javascript/content/101-javascript-variables/103-scopes/index.md index 0c0bac88f..30cd4b06d 100644 --- a/src/data/roadmaps/javascript/content/101-javascript-variables/103-scopes/index.md +++ b/src/data/roadmaps/javascript/content/101-javascript-variables/103-scopes/index.md @@ -10,6 +10,8 @@ Function Scope: Variables declared within a function can only be used within tha Block Scope: A block is any part of JavaScript code bounded by '{}'. Variables declared within a block can not be accessed outside that block. This Scope is only provided by the `let` and `const` keywords. If you declare a variable within a block using the `var` keyword, it will NOT have Block Scope. +Local Scope: Local variables are only recognized inside their functions, variables with the same name can be used in different functions. Local variables are created when a function starts, and deleted when the function is completed. `var`, `let` and `const` all provide this Scope. + Visit the following resources to learn more: - [JavaScript Scope](https://www.w3schools.com/js/js_scope.asp)