JavaScript Conditional Statements Quiz

JavaScript Conditional Statements Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Podstawy Pythona

Podstawy Pythona

9th - 12th Grade

10 Qs

Email of request

Email of request

12th Grade - Professional Development

11 Qs

Unit 2, 1.3 Types of information access and storage devices

Unit 2, 1.3 Types of information access and storage devices

12th Grade

11 Qs

Operating system

Operating system

11th - 12th Grade

10 Qs

Ms. Exel dan Fungsi Logika IF

Ms. Exel dan Fungsi Logika IF

10th Grade - University

15 Qs

STS Informatika

STS Informatika

10th Grade - University

20 Qs

SOAL PTS 1 KOMPUTER AKUNTANSI KELAS XI

SOAL PTS 1 KOMPUTER AKUNTANSI KELAS XI

11th Grade - University

10 Qs

Computer Lab Rules

Computer Lab Rules

9th - 12th Grade

13 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

Access all questions and much more by creating a free account

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?