Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Var 3/3 | Data Types and Variables
Introduction to JavaScript (staging)
course content

Зміст курсу

Introduction to JavaScript (staging)

Introduction to JavaScript (staging)

1. Introduction
2. JavaScript syntax
3. Data Types and Variables

Var 3/3

Why <code class="go3679463865">var</code> is not used now

Due to hoisting and the global scope declaring variables with the var leads to so much confusion in the code. If we change the value of a variable at just one place intentionally the var will change that value all over the code. It will create so many unexpected results in our code.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Summary:

  • The var is an alternative to the let keyword in JavaScript.
  • Variables declared with var can be accessed before the declaration.
  • The let and const do not allow hoisting but var does.
  • It is not a good practice to use var instead we should use let.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 6
toggle bottom row

Var 3/3

Why <code class="go3679463865">var</code> is not used now

Due to hoisting and the global scope declaring variables with the var leads to so much confusion in the code. If we change the value of a variable at just one place intentionally the var will change that value all over the code. It will create so many unexpected results in our code.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Summary:

  • The var is an alternative to the let keyword in JavaScript.
  • Variables declared with var can be accessed before the declaration.
  • The let and const do not allow hoisting but var does.
  • It is not a good practice to use var instead we should use let.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 6
toggle bottom row

Var 3/3

Why <code class="go3679463865">var</code> is not used now

Due to hoisting and the global scope declaring variables with the var leads to so much confusion in the code. If we change the value of a variable at just one place intentionally the var will change that value all over the code. It will create so many unexpected results in our code.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Summary:

  • The var is an alternative to the let keyword in JavaScript.
  • Variables declared with var can be accessed before the declaration.
  • The let and const do not allow hoisting but var does.
  • It is not a good practice to use var instead we should use let.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Why <code class="go3679463865">var</code> is not used now

Due to hoisting and the global scope declaring variables with the var leads to so much confusion in the code. If we change the value of a variable at just one place intentionally the var will change that value all over the code. It will create so many unexpected results in our code.

Завдання

Hoisting is used in the following code and this code does not give any error but not a preferable approach. Your task is, using only the let keyword, to re-arrange the variables in the code and display all the variables.

Summary:

  • The var is an alternative to the let keyword in JavaScript.
  • Variables declared with var can be accessed before the declaration.
  • The let and const do not allow hoisting but var does.
  • It is not a good practice to use var instead we should use let.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 3. Розділ 6
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt