Question : short if
Answered by : adventurous-ant-ev07mhqo0m1b
condition ? doThisIfTrue : doThisIfFalse
1 > 2 ? console.log(true) : console.log(false)
// returns false
Source : | Last Update : Thu, 28 May 20
Question : shorten if
Answered by : herte-cristian-paul
condition ? expressionIfTrue : expressionIfFalse
Source : https://betterprogramming.pub/5-alternatives-to-if-statements-for-conditional-branching-6e8e6e97430b | Last Update : Wed, 30 Mar 22