118
rated 0 times
[
125]
[
7]
/ answers: 1 / hits: 95041
/ 13 Years ago, mon, january 16, 2012, 12:00:00
I know that in PHP 5.3 instead of using this redundant ternary operator syntax:
startingNum = startingNum ? startingNum : 1
...we can use a shorthand syntax for our ternary operators where applicable:
startingNum = startingNum ?: 1
And I know about the ternary operator in JavaScript:
startingNum = startingNum ? startingNum : 1
...but is there a shorthand?
More From » conditional-operator