Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Constant 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

Constant 3/3

<code class="go3679463865">const</code> Does Not Allow Hoisting

As discussed in the previous chapter, let does not allow hoisting i.e. we cannot use a variable before the declaration. Just like let we can not use hoisting with the const.it is only supported with var.

123
MYPLANET = 'earth'; console.log(MYPLANET); const MYPLANET;
copy

Завдання

Rearrange the following code to display the value of SALARY on the console.

Завдання

Rearrange the following code to display the value of SALARY on the console.

Summary:

  • We can neither change the values of the const variables through reassignment nor we can redeclare them.
  • Value should be assigned to const variables at the time of declaration.

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

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

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

Constant 3/3

<code class="go3679463865">const</code> Does Not Allow Hoisting

As discussed in the previous chapter, let does not allow hoisting i.e. we cannot use a variable before the declaration. Just like let we can not use hoisting with the const.it is only supported with var.

123
MYPLANET = 'earth'; console.log(MYPLANET); const MYPLANET;
copy

Завдання

Rearrange the following code to display the value of SALARY on the console.

Завдання

Rearrange the following code to display the value of SALARY on the console.

Summary:

  • We can neither change the values of the const variables through reassignment nor we can redeclare them.
  • Value should be assigned to const variables at the time of declaration.

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

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

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

Constant 3/3

<code class="go3679463865">const</code> Does Not Allow Hoisting

As discussed in the previous chapter, let does not allow hoisting i.e. we cannot use a variable before the declaration. Just like let we can not use hoisting with the const.it is only supported with var.

123
MYPLANET = 'earth'; console.log(MYPLANET); const MYPLANET;
copy

Завдання

Rearrange the following code to display the value of SALARY on the console.

Завдання

Rearrange the following code to display the value of SALARY on the console.

Summary:

  • We can neither change the values of the const variables through reassignment nor we can redeclare them.
  • Value should be assigned to const variables at the time of declaration.

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

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

<code class="go3679463865">const</code> Does Not Allow Hoisting

As discussed in the previous chapter, let does not allow hoisting i.e. we cannot use a variable before the declaration. Just like let we can not use hoisting with the const.it is only supported with var.

123
MYPLANET = 'earth'; console.log(MYPLANET); const MYPLANET;
copy

Завдання

Rearrange the following code to display the value of SALARY on the console.

Summary:

  • We can neither change the values of the const variables through reassignment nor we can redeclare them.
  • Value should be assigned to const variables at the time of declaration.

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