ABSTRACT

Mike: The first one wasn’t that difficult. We discovered that it is even possible to write it with a single conditional operator, combined with the remainder operator for checking whether the number is divisible by two. We use the concatenation operator to make the message more explanatory. Parentheses are necessary because the concatenation operator has precedence over the conditional one. This is the code:

Professor: I like your solution and I see that you understand how JavaScript operators work.