> You can write isNumber(foo) instead of typeof foo === "number".
Indeed you can, but it depends what isNumber does. This is more like what it should do IMO:
function isNumber( foo ) {
return (
(typeof foo === "number") && (foo == foo)) ||
((typeof foo === 'object') && (foo instanceof Number)
);
}
And that is I think the value of micro libs, at least in JS, you don't want to think about all the edge cases when you only want to check if something is a Number.