Ruby: x.is_a? Integer
PHP: is_int($x) (alias of is_integer)
Python: isinstance(x, int)
Node.js[1]:
typeof val === "number" &&
(!(typeof value !== 'number' || value !== value || value === Infinity || value === -Infinity)) &&
Math.floor(val) === val
I think all supported Node.js versions now have Number.isInteger (via es262), but the is-integer package still gets a 200_000 downloads a week[2].[1]: https://github.com/parshap/js-is-integer/blob/master/index.j...