Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare a variable with a string value.
Javascript
let greeting = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes for string values.
Using a number or boolean without quotes.
✗ Incorrect
The value assigned to a string variable must be enclosed in quotes.
2fill in blank
mediumComplete the code to declare a variable with a boolean value.
Javascript
const isActive = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around true or false.
Using capitalized False instead of lowercase false.
✗ Incorrect
Boolean values are true or false without quotes.
3fill in blank
hardFix the error in the code to correctly assign a number.
Javascript
let age = [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers inside quotes making them strings.
Using words instead of digits for numbers.
✗ Incorrect
Numbers are written without quotes in JavaScript.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings for name.
Putting numbers in quotes for age.
✗ Incorrect
The name property needs a string with quotes, and age needs a number without quotes.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around undefined or null.
Using lowercase symbol instead of Symbol.
✗ Incorrect
undefined and null are primitive values, and Symbol is a function to create unique symbols.