You cannot use if…then statements inside expressions. Use the ternary operator (condition ? valueIfTrue : valueIfFalse) to select between two values inline. This is useful whenever an expression is required rather than a statement.
You cannot use if…then statements inside expressions. Use the ternary operator (condition ? valueIfTrue : valueIfFalse) to select between two values inline. This is useful whenever an expression is required rather than a statement.