Categorized | News

The Ternary Operator

Posted on 03 July 2001 by Demian Turner

No Looking Back
Once you discover the ternary operator, there’s no looking back. It greatly simplifies and compacts ‘if’ statements where there are only two options, ie, if and else.

The following code example demonstrates one use of the ternary operator (which occurs on line 9):

Bookmark and Share

Leave a Reply

Categories

Books

Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists

Facebook