You may use isInteger() method of Number object
if ( (new Number(x)).isInteger() ) { // handle integer } This method works properly if x is undefined or null. But it has poor browser support for now
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack Internal You may use isInteger() method of Number object
if ( (new Number(x)).isInteger() ) { // handle integer } This method works properly if x is undefined or null. But it has poor browser support for now
You may use isInteger() method of Number object
if ( (new Number(x)).isInteger() ) { // handle integer } This method works properly if x is undefined or null
You may use isInteger() method of Number object
if ( (new Number(x)).isInteger() ) { // handle integer } This method works properly if x is undefined or null. But it has poor browser support for now