typeof n === 'number'
It didn't actually require differentiating between integers and floats, just numbers and other types.
It didn't actually require differentiating between integers and floats, just numbers and other types.
Normally javascript function inputs aren't this messy.
> typeof 5.4
"number"I mentally skipped over Justin_Time's solution, figuring I would just hit a float error case because it was going to be a stickler about integers.