0
0
Javascriptprogramming~10 mins

Variable declaration using let 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 variable named age using let.

Javascript
[1] age = 25;
Drag options to blanks, or click blank then click option'
Alet
Bvar
Cconst
Dint
Attempts:
3 left
💡 Hint
Common Mistakes
Using var instead of let.
Using const which does not allow reassignment.
Using non-JavaScript keywords like int.
2fill in blank
medium

Complete the code to declare a variable name and assign it the string 'Alice' using let.

Javascript
[1] name = 'Alice';
Drag options to blanks, or click blank then click option'
Aconst
Blet
Cfunction
Dvar
Attempts:
3 left
💡 Hint
Common Mistakes
Using const which prevents reassignment.
Using function which is not for variable declaration.
3fill in blank
hard

Fix the error by completing the code to declare a variable count with let.

Javascript
let [1] = 10;
Drag options to blanks, or click blank then click option'
Alet
B10
Cvar
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number as a variable name.
Using keywords as variable names.
4fill in blank
hard

Fill both blanks to declare two variables x and y using let and assign them values 5 and 10.

Javascript
[1] x = 5; [2] y = 10;
Drag options to blanks, or click blank then click option'
Alet
Bconst
Dvar
Attempts:
3 left
💡 Hint
Common Mistakes
Using const which prevents reassignment.
Using var instead of let.
5fill in blank
hard

Fill all three blanks to declare variables a, b, and c using let and assign them values 1, 2, and 3 respectively.

Javascript
[1] a = 1; [2] b = 2; [3] c = 3;
Drag options to blanks, or click blank then click option'
Alet
Bconst
Cvar
Attempts:
3 left
💡 Hint
Common Mistakes
Using const which prevents reassignment.
Using var instead of let.