0
0
Javascriptprogramming~10 mins

Variable declaration using const in Javascript - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare a constant named pi with the value 3.14.

Javascript
const [1] = 3.14;
Drag options to blanks, or click blank then click option'
Api
Bcircumference
Carea
Dradius
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name that does not describe the value.
Trying to use 'let' or 'var' instead of 'const'.
2fill in blank
medium

Complete the code to declare a constant MAX_USERS with the value 100.

Javascript
const [1] = 100;
Drag options to blanks, or click blank then click option'
AMaxUsers
BmaxUsers
Cmax_users
DMAX_USERS
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase instead of uppercase with underscores.
Using lowercase letters for constant names.
3fill in blank
hard

Fix the error in the code by completing the constant declaration for API_URL.

Javascript
const [1] = 'https://api.example.com';
Drag options to blanks, or click blank then click option'
AApiUrl
BapiUrl
CAPI_URL
Dapi_url
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase or lowercase for constant names.
Using variable names that do not follow constant naming conventions.
4fill in blank
hard

Fill both blanks to declare constants for SECONDS_IN_MINUTE and MINUTES_IN_HOUR.

Javascript
const [1] = 60;
const [2] = 60;
Drag options to blanks, or click blank then click option'
ASECONDS_IN_MINUTE
BsecondsInMinute
CMINUTES_IN_HOUR
DminutesInHour
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase instead of uppercase with underscores.
Mixing up the names or values.
5fill in blank
hard

Fill all three blanks to declare constants for PI, EULER, and GRAVITY with their respective values.

Javascript
const [1] = 3.14159;
const [2] = 2.71828;
const [3] = 9.8;
Drag options to blanks, or click blank then click option'
API
BEULER
CGRAVITY
Dgravity
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or camelCase names for constants.
Mixing up the order of constants.