JavaScript Ternary Operator

Quiz
•
Computers
•
9th Grade
•
Hard
Mhaya Santos
Used 23+ times
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
If-Statement and Relational Operators Quiz

Quiz
•
6th Grade - University
10 questions
Code.org Discoveries

Quiz
•
9th - 11th Grade
13 questions
IC3 Level 1 Domain 3 Assessment

Quiz
•
6th - 12th Grade
15 questions
Python Basics Quiz

Quiz
•
9th Grade
13 questions
CTE Information Technology Quiz

Quiz
•
7th - 9th Grade
12 questions
Grade 9 Robotics - Quiz 1

Quiz
•
9th Grade
10 questions
Scratch - Conditional statements

Quiz
•
7th - 9th Grade
10 questions
Understanding Pseudocode Basics

Quiz
•
6th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade