expressions with conditionals

tested with console.log to test formula