2 ms·
if it were C#, I’d write it along the lines of !(n as bool), but for the purposes of JS, I suppose something like: const IsNumber = (value) => Boolean(value);
by 9wzYQbTYsAIc 5y ago
if it were C#, I’d write it along the lines of !(n as bool), but for the purposes of JS, I suppose something like:
const IsNumber = (value) => Boolean(value);
!IsNumber(n)
I’m not a fan of using the return-type as the function name, especially when you are really just trying to find out if something is a number.