Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Constant Naming Convention | JavaScript syntax
Introduction to JavaScript

Swipe to show menu

book
Constant Naming Convention

Constant naming convention

Constants are planned to be non-changing variables. It is best to practice to distinguish constants from other variables and the best way to write them is in UPPERCASE (capital letters).

123456
// UPPERCASE const SECONDS = 60; const MINUTES = 60; const HOURS = 24; const DAY = SECONDS * MINUTES * HOURS; console.log(DAY);
copy
Task

Swipe to start coding

Store the value of pi in the constant and name it with an uppercase and show it on the console.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 10
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 2

book
Constant Naming Convention

Constant naming convention

Constants are planned to be non-changing variables. It is best to practice to distinguish constants from other variables and the best way to write them is in UPPERCASE (capital letters).

123456
// UPPERCASE const SECONDS = 60; const MINUTES = 60; const HOURS = 24; const DAY = SECONDS * MINUTES * HOURS; console.log(DAY);
copy
Task

Swipe to start coding

Store the value of pi in the constant and name it with an uppercase and show it on the console.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 2

Swipe to show menu

some-alt