
JavaScript Conditional Statements Flashcard
Flashcard
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

15 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What will the following code output?
```javascript
if (5 > 3) {
console.log("Yes");
} else {
console.log("No");
}
```
Back
Yes
2.
FLASHCARD QUESTION
Front
Consider the code snippet below. What will be the output?
```javascript
let age = 18;
if (age > 18) {
console.log("Adult");
} else if (age == 18) {
console.log("Just turned adult");
} else {
console.log("Not an adult");
}
```
Back
Just turned adult
3.
FLASHCARD QUESTION
Front
What does the following code print?
```javascript
let x = 10;
if (x > 5) {
if (x < 15) {
console.log("Yes");
}
} else {
console.log("No");
}
```
Back
Yes
4.
FLASHCARD QUESTION
Front
Which of the following is true about the `else` statement in JavaScript? Options: It executes a block of code if the condition in the `if` statement is true., It can appear without an `if` statement., It executes a block of code if the condition in the `if` statement is false., It can only be used once in an `if-else` chain.
Back
It executes a block of code if the condition in the `if` statement is false.
5.
FLASHCARD QUESTION
Front
How many times can `else if` statements be used in an `if-else` chain?
Back
As many times as needed
6.
FLASHCARD QUESTION
Front
What will the following code snippet output?
```javascript
let score = 75;
if (score >= 90) {
console.log("A");
} else if (score >= 80) {
console.log("B");
} else if (score >= 70) {
console.log("C");
} else {
console.log("F");
}
```
Back
C
7.
FLASHCARD QUESTION
Front
What is the output of the following code?
```javascript
let num = 20;
if (num > 15) {
console.log("Greater");
} else if (num == 20) {
console.log("Equal");
} else {
console.log("Lesser");
}
```
Back
Greater
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Kindergarten Math
Flashcard
•
KG
15 questions
Addition
Flashcard
•
KG
15 questions
Single and Double digit vertical addition.
Flashcard
•
KG
15 questions
Histograms
Flashcard
•
KG - University
15 questions
Chapter 2 Laws of Motion
Flashcard
•
KG - University
15 questions
Algebra CC Midterm Review (Units 1A, 1B, 2 and 3)
Flashcard
•
KG - University
10 questions
stats vocab 5.1 - 5.2
Flashcard
•
12th Grade
15 questions
Conditional sentences type 2
Flashcard
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade