JavaScript Conditionals Quiz

JavaScript Conditionals Quiz

12th Grade

22 Qs

quiz-placeholder

Similar activities

School Mangement System ICT 0417 IGCSE

School Mangement System ICT 0417 IGCSE

10th - 12th Grade

18 Qs

Pemrograman Dasar 3

Pemrograman Dasar 3

9th - 12th Grade

20 Qs

Adobe Illustrator Quiz Review

Adobe Illustrator Quiz Review

9th - 12th Grade

27 Qs

ZTE Phone Quiz

ZTE Phone Quiz

1st Grade - Professional Development

17 Qs

Đề ôn tập cuối HKI lớp 5

Đề ôn tập cuối HKI lớp 5

6th Grade - University

17 Qs

JavaScript Conditionals Quiz

JavaScript Conditionals Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Andell Haughton

Used 16+ times

FREE Resource

AI

Enhance your content in a minute

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

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for an if statement in JavaScript?

if (x > 0) { }

if x > 0: { }

if x > 0 then { }

if (x > 0) then { }

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which logical operator is used in JavaScript to represent "AND"?

&&

||

!

==

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output? ```javascript if (false || true) { console.log("True"); } else { console.log("False"); } ```

True

False

Error

Nothing

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you write an if statement in JavaScript to execute some code if "x" is either greater than 10 or less than or equal to 20?

if (x > 10 || x <= 20)

if (x > 10 && x <= 20)

if x > 10 or x <= 20

if x > 10 and x <= 20

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet? ```javascript let x = 5; if (x > 3) { if (x < 10) { console.log("Yes"); } } else { console.log("No"); } ```

Yes

No

Error

Nothing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used in JavaScript to check both the value and the type?

==

===

!=

!==

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following JavaScript code output? ```javascript let age = 18; if (age > 18) { console.log("Adult"); } else if (age == 18) { console.log("Just an adult"); } else { console.log("Not an adult"); } ```

Adult

Just an adult

Not an adult

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?