function concatenator ( a , b ) { / / concatenator takes two arguments named a and
Fantastic news! We've Found the answer you've been seeking!
Question:
function concatenatorab
concatenator takes two arguments named a and b:
If a and b are strings, return them concatenated
If a and b are numbers, return their sum
Other conditions that must be met:
Both a and b must be of the same type. If they are not the same type, return the string "a and b must be of the same type"
a and b can be either numbers or strings. If they are not, return "a and b must be numbers or strings"
Hint: The order of the conditions in the pseudocode above and in the actual code is not necessarily the same
Hint: It's advised to deal with the other conditions first, like arguments being of the wrong type.
Related Book For
Posted Date: