I CAN HAZ NUMBER?!
Tuesday, January 01, 2008 — 17:33
I don’t want to write much. Here’s the scoop.
Prototype.js doesn’t have a properly working isNumber check. Here’s the correct one.
Object.isNumber = function(object)
{
return (((typeof object) == 'number') && (!isNaN(object)));
}
Difference should be obvious.
(In retrospect, I guess it depends on what your definition of “number” is. In my opinion, when you’re programming, if you can’t add it to another number, it’s not a useful number.)