src/util/Util.js
/**
 * Test whether an object is either an integer or the string representation of an integer.
 * <p>This is adapted from: https://stackoverflow.com/a/14794066</p>
 *
 * @name module:util.isInt
 * @function
 * @public
 * @param {Object} obj - the input object
 * @returns {boolean} whether or not the object is an integer or the string representation of an integer
 */
Test whether an object is either an integer or the string representation of an integer.


Test whether an object is either an integer or the string representation of an integer .
function isInt(obj)
{
	if (isNaN(obj))
	{
		return false;
	}
	const x = parseFloat(obj);
	return (x | 0) === x;
}
function isInt ( obj ) { if ( isNaN ( obj ) ) { return false ; } const x = parseFloat ( obj ) ; return ( x | 0 ) === x ; }
Test whether an object is either an integer or the string representation of an integer.
Test whether an object is either an integer or the string representation of an integer .