Inline If statement

In order to save the lines of code instead of using the typical if else we can use inline if statment:

skeleton is (a condition b ? do this() : do that())



(a>3 ? peal() : leave())

In above example a will be checked if it’s bigger than 3 if so run peal() if not run leave()


getAge(a>3 ? a=10: null)

in above example if a more than 3 then a will be assigned to 10 if not then get will run with value null.