Hacker News new | past | comments | ask | show | jobs | submit login

if `if` was an expression rather than a statement one could write

return if condition() 10 else 20

I am not sure this is more readable though.




There is an 'if' expression, it's just spelled '?' and else is ':'. Mentioned a few posts up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: