NEW
Font size
WorksheetsControl Flow
Total questions: 10
Worksheet time: 5mins
Which keyword can one use make a decision based on a condition?
if
let
how
ifToSay
Bisi wants to check if a users age is above 20 and the user is from Nigeria, which if statement can she use?
if (age >=20 && country = 'Nigeria')
if (age > 20 && country === 'Nigeria')
if (age ===20 && country === 'Nigeria')
if (age >= 20 && country === 'Nigeria')
If we need to add multiple conditions, what keyword can we use?
evenThough
else
justBecause
other
Which of the following does this:
The age should be equal to or above 10 OR the gender should be male
if (gender === 'male' && age > 10)
if (gender = 'male' && age >= 10)
if (gender === 'male' || age >= 10)
if (gender === 'male' || age > 10)
Which looping construct in JavaScript is used for iterating over the elements of an array or characters of string?
for loop
continue loop
break loop
insert loop
What is the purpose of the continue statement in a loop
To terminate the loop and exit
To skip the current iteration and move to the next one
To restart the loop from the beginning
To continue to the next iteration of the loop
What is the purpose of the break statement in a loop
To terminate the loop and exit
To skip the current iteration and move to the next one
To restart the loop from the beginning
To continue to the next iteration of the loop
for (let i = 0; i < 10; i++)
How many times would the loop run?
10
11
9
8
Can we use the for loop to iterate over a string?
Yes
No
maybe
I don't know
for (let i = 0; i >= 10; i++)
How many times would this run?
0
10
11
9
