Shorthand for if-else statement
Using the ternary 😕 operator [spec]. var hasName = (name === ‘true’) ? ‘Y’ :’N’; The ternary operator lets us write shorthand if..else statements exactly like you want. It looks like: (name === ‘true’) – our condition ? – the ternary operator itself ‘Y’ – the result if the condition evaluates to true ‘N’ – … Read more