JavaScript Ternary Operator

JavaScript Ternary Operator

9th Grade

11 Qs

quiz-placeholder

Similar activities

Python - True or False?

Python - True or False?

7th - 11th Grade

14 Qs

7.02 going online

7.02 going online

4th - 9th Grade

10 Qs

TQ - Review Quiz Week 1

TQ - Review Quiz Week 1

9th Grade

10 Qs

IX AI

IX AI

9th Grade

10 Qs

ICT 9 Quiz 1

ICT 9 Quiz 1

9th Grade

10 Qs

loop while/do while

loop while/do while

7th - 12th Grade

10 Qs

Theme E Chapter 2 Wireless Network

Theme E Chapter 2 Wireless Network

9th Grade

15 Qs

STRUKTUR KAWALAN ULANGAN

STRUKTUR KAWALAN ULANGAN

1st - 12th Grade

12 Qs

JavaScript Ternary Operator

JavaScript Ternary Operator

Assessment

Quiz

Computers

9th Grade

Practice Problem

Hard

Created by

Mhaya Santos

Used 24+ times

FREE Resource

AI

Enhance your content in a minute

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

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

An operator that assigns a value to a variable based on some condition.

Ternary Operator

Comparison Operator

Logical Operator

IfElse Operator

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Click the three operands of Conditional ternary operator

condition followed by a question mark (?)

expression to execute if the condition is truth followed by a colon (:)

expression to execute if the condition is false.

if expression showing the condition

expression to execute if the statement is true

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

It is an expression which is executed if the condition is false.

exprIfFalse

condition

exprIfTrue

expIfElse

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for Javascript Ternary?

condition ? exprIfTrue ; exprIfFalse

expression ? exprIfTrue : exprIfFalse

condition ? exprIfTrue : exprIfFalse

condition ? exprIfFalse : exprIfTrue

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct comparison operator to display "true", when: 10 is greater than 7.

10 < 7

10 !< 7

10 != 7

10 > 7

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A ternary syntax showing if the variable firstName is equal to "John", the value of the variable result should be "Hello John!", otherwise the value of result should be "You're not John!".

var result = (firstName == "John") ? "Hello John!" : "You're not John!";

var result = (firstName === "John") ? "Hello John!" : "You're not John!";

var result = (firstName === "John") ! "Hello John!" : "You're not John!";

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

if x=10 what will be the result of

document.getElementById("demo").innerHTML = x !> 7;

false

true

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?