Tip of the week #1
Preston Alvarado
July 11, 2011
Tips & Tricks
No Comments
Tags: operators, ternary, tips, tips of the week
Today is the first “Tip of the week”. A new mini series I’ll be publishing every week! So let’s get started.
Today’s subject is over Ternary operations. These operations can improve your code and make it easier to read. However sometimes can make your code really complex. A Ternary operation is basically just a if else statement that many languages support.
The general syntax usually looks similar to this.
(expression ? true expression : false expression)