WorksheetsJavascript Conditional Statements
Total questions: 20
Worksheet time: 11mins
Greater than or equal to
> or =
> || =
>=
<=
What Javascript code matches this statement:
Their name is Kim and they are less than 16 years old
if (name = "Kim" && age < 16 )
if (name === "Kim" && age < 16 )
if (name = "Kim" || age < 16 )
if (name === "Kim" || age < 16 )
What symbol represents the and operator in JavaScript?
AND
and
&
&&
What symbol represents the or operator in JavaScript?
OR
or
||
|
What is == ?
What is === ?
What is != ?
What is ! == ?
What is >= ?
What is <= ?
What is && ?
What is ! ?
What Javascript code matches this statement:
The score is not 0
if (score != 0)
if (score =! 0)
if (score not 0)
if (score !! 0)
What Javascript code matches this statement:
The player's health is 0 and they still have a life remaining.
if (health == "0" && lives > "0")
if (health === 0 && lives > 0)
if (health === 0 && lives >= 0)
if (health <1 && lives > 0)
What Javascript code matches this statement:
The player has gathered at least 300 coins or reached the end of the level.
if ("coins" >= 300 && "end" == true)
if (coins >= 300 || end == true)
if ("coins" >= 300 OR "end" == true)
if ("coins" >= 300 || "end" == true)
Fill in the blank to match the statement:
The player has at least 2 lives remaining.
if( (a) )
Do not use spaces.
Fill in the blank to match the statement:
The score is no more than 20.
if( (a) )
Do not use spaces.
Fill in the blank to match the statement:
The machine is not running.
if( (a) )
Do not use spaces. There are multiple possible answers.
Fill in the blank to match the statement:
It is either this or that.
if( (a) )
Do not use spaces. There are multiple possible answers.
