0
0
Javascriptprogramming~10 mins

Primitive data types 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 with a string value.

Javascript
let greeting = [1];
Drag options to blanks, or click blank then click option'
A123
BHello
C"Hello"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes for string values.
Using a number or boolean without quotes.
2fill in blank
medium

Complete the code to declare a variable with a boolean value.

Javascript
const isActive = [1];
Drag options to blanks, or click blank then click option'
Atrue
B"true"
C1
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around true or false.
Using capitalized False instead of lowercase false.
3fill in blank
hard

Fix the error in the code to correctly assign a number.

Javascript
let age = [1];
Drag options to blanks, or click blank then click option'
A"25"
Btwentyfive
Ctrue
D25
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers inside quotes making them strings.
Using words instead of digits for numbers.
4fill in blank
hard

Fill both blanks to create an object with a string and a number property.

Javascript
const person = { name: [1], age: [2] };
Drag options to blanks, or click blank then click option'
A"Alice"
B30
Ctrue
DAlice
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings for name.
Putting numbers in quotes for age.
5fill in blank
hard

Fill all three blanks to create a variable with undefined, null, and symbol values.

Javascript
let a = [1];
let b = [2];
let c = [3]('id');
Drag options to blanks, or click blank then click option'
Aundefined
Bnull
CSymbol
Dsymbol
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around undefined or null.
Using lowercase symbol instead of Symbol.