Back to Course

Introduction to JavaScript

0% Complete
0/0 Steps
  1. JavaScript: Basics
    9Topics
    |
    10 Quizzes
  2. JavaScript: Variables
    9Topics
    |
    10 Quizzes
  3. JavaScript: Conditional Statements
    10Topics
    |
    11 Quizzes
  4. JavaScript: Functions
    10Topics
    |
    11 Quizzes
  5. JavaScript: Scope
    6Topics
    |
    7 Quizzes
  6. JavaScript: Arrays
    11Topics
    |
    12 Quizzes
  7. JavaScript: Loops
    8Topics
    |
    9 Quizzes
  8. JavaScript: High Order Functions
    3Topics
    |
    3 Quizzes
Lesson 5, Topic 1
In Progress

JavaScript: Introduction to Scope

Yasin Cakal 10 Nov 2021
Lesson Progress
0% Complete

The concept of scope is extremely important in programming. The scope of a variable determines where it can be accessed or referenced. While some variables can be accessed from anywhere in a program, others may only be available in certain conditions.

Consider the view of the night sky from your window as an example of scope. Everyone who lives on the planet Earth is a part of this universe. The stars are visible from anywhere on the planet. In the meantime, if you live in a city, you might be able to see the river. Although the river is only visible in your city, you can still see the stars that are visible worldwide.

In the following exercises, we’ll look at how scope relates to variables and learn best practices for variable declaration.

Responses

Leave a Reply

%d bloggers like this: