
JavaScript Conditional Statements Flashcard

Flashcard
•
Computers
•
12th Grade
•
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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
MANI

Flashcard
•
KG - University
15 questions
Evaluate Logarithms Check

Flashcard
•
12th Grade
15 questions
AB PrecCalc Log Graphs/Exp Graphs

Flashcard
•
12th Grade
11 questions
Vocab 11.2.3-4 (Harry Potter)

Flashcard
•
11th Grade
15 questions
Solving Logarithmic Equations

Flashcard
•
11th - 12th Grade
11 questions
Sphero Block Coding

Flashcard
•
KG - 12th Grade
14 questions
Unit 4 Assessment Day

Flashcard
•
9th - 12th Grade
15 questions
4 Arduino: Digital Inputs

Flashcard
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade