function fn(val) { return typeof val === "number" && isFinite(val) && Math.floor(val) === val; };
Reply on news.ycombinator.com