Please find encoded
Sharing my passion for programming
Friday, 22 January 2016
Post 40: How to check for integer in JavaScript
In JavaScript there is no better way:
var isInt = function (x) {
return (typeof Number(x) === 'number') && (x % 1 === 0);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Tweet
No comments:
Post a Comment