From the course: Learning the JavaScript Language
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Jargon: Scope in JavaScript - JavaScript Tutorial
From the course: Learning the JavaScript Language
Jargon: Scope in JavaScript
- [Instructor] It's time for a brief digression to deal with a little jargon you might hear about. JavaScript is super popular and draws a lot of attention from developers of many skill and experience levels. So knowing where some jargon comes from can help you with possibly boring parties. Here, we're going to talk about scope. Scope refers to where variables are defined and what parts of our code can access the variables that we define. Often when we talk about scope, we differentiate between global scope and local scope. Global refers to variables that are defined in such a way that they are accessible anywhere. Local means that a variable is accessible in a way that's more limited, perhaps only inside a particular function. One piece of guidance almost every beginning programmer gets is to avoid creating global variables. Global variables are accessible everywhere, which is very convenient, but the global name space as…
Contents
-
-
-
-
-
-
-
-
(Locked)
Basic functions4m 20s
-
(Locked)
Arguments and parameters in functions6m 54s
-
(Locked)
More on function arguments5m 3s
-
(Locked)
Objects, references, and functions7m 4s
-
(Locked)
Functions are objects5m 8s
-
(Locked)
Jargon: Scope in JavaScript2m 30s
-
(Locked)
Functions and scope5m 11s
-
(Locked)
Writing shorter functions with arrows3m 12s
-
(Locked)
Three little dots collect the rest4m 14s
-
(Locked)
Callback functions and looping4m 34s
-
(Locked)
-
-