Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

ternary

The ternary operator will return the value on the left of the colon( : ) if the expression is true, and return the value on the right of the colon if the expression is false.

Syntaxexpression ? true_data : false_data

Examples

var result = (5 > 3) ? "That is true" : "That is false";

JavaScript

Operators

deleteinstanceofnewthistypeofternaryvoid