True. If the function is supposed to be something like, getParity, and returns 0 or 1 depending on if it's even or odd, then it should definitely throw if you give it something other than an integer. With isEvenNumber, it's closer, because a string or a function or a decimal or whatever isn't an even number.
6
u/Andersmith Mar 27 '21
Technically it won’t work if given a non integer value (like .2), but input sanitation seems a bit too nitpicky of an issue for this sub.