JavaScript Conditional Statements Quiz

JavaScript Conditional Statements Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Digital Etiquette

Digital Etiquette

4th Grade - University

15 Qs

สอบเก็บคะแนน ไพทอน ม.4

สอบเก็บคะแนน ไพทอน ม.4

9th - 12th Grade

10 Qs

Accounting Digital Kelas XII AKL

Accounting Digital Kelas XII AKL

12th Grade

10 Qs

básico de Code

básico de Code

10th - 12th Grade

14 Qs

Spreadsheet

Spreadsheet

8th Grade - University

20 Qs

Tarkie Seminar for Disers

Tarkie Seminar for Disers

9th - 12th Grade

10 Qs

Protecting Yourself Online Lesson 8 of the CIW

Protecting Yourself Online Lesson 8 of the CIW

12th Grade

16 Qs

SHEET QUIZ

SHEET QUIZ

9th - 12th Grade

15 Qs

JavaScript Conditional Statements Quiz

JavaScript Conditional Statements Quiz

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Lara Luca

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output? ```javascript if (5 > 3) { console.log("Yes"); } else { console.log("No"); } ```

Yes

No

Undefined

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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"); } ```

Adult

Just turned adult

Not an adult

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code print? ```javascript let x = 10; if (x > 5) { if (x < 15) { console.log("Yes"); } } else { console.log("No"); } ```

Yes

No

Undefined

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about the `else` statement in JavaScript?

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.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times can `else if` statements be used in an `if-else` chain?

Only once

Up to 3 times

As many times as needed

Not at all

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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"); } ```

A

B

C

F

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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"); } ```

Greater

Equal

Lesser

Error

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?