An operator that assigns a value to a variable based on some condition.
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
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 Quizizz
10 questions
Conditionals - codeHS mod4

Quiz
•
9th - 12th Grade
10 questions
C++ Basics Quiz

Quiz
•
9th - 12th Grade
10 questions
AP Computer Science Principles - Unit 4: Variables, Conditionals

Quiz
•
9th - 12th Grade
12 questions
IDT UNIT 3

Quiz
•
9th - 12th Grade
10 questions
Excel If function WSC 4.2.3

Quiz
•
7th Grade - University
13 questions
Python Operators & Expressions

Quiz
•
8th - 11th Grade
10 questions
Selection Control Structure Quiz

Quiz
•
6th Grade - University
13 questions
KS4 Python While Loops and For Loops

Quiz
•
9th - 11th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University