paint-brush
Learn Javascript Fundamentals-Local Scopeby@sumeyra-davran
206 reads

Learn Javascript Fundamentals-Local Scope

by Sümeyra Davran3mAugust 10th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Global Scope is the first part of understanding scopes in Javascript. Local Scope occurs when you create a variable inside a function, not a global one. Local scope can be divided into two scopes: Function Scope and Block Scope. Until ES6, Javascript only had function scope which is what I have been explaining so far. In Javascript, when you define a variable in global scope and then in local scope, local one takes precedence. Local variables are not accessible and are destroyed as soon as their scope ends.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Learn Javascript Fundamentals-Local Scope
Sümeyra Davran HackerNoon profile picture
Sümeyra Davran

Sümeyra Davran

@sumeyra-davran

L O A D I N G
. . . comments & more!

About Author

Sümeyra Davran HackerNoon profile picture
Sümeyra Davran@sumeyra-davran

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite