Skip to main content
added 178 characters in body
Source Link
Sneg
  • 1.2k
  • 1
  • 12
  • 18

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

Source Link
Sneg
  • 1.2k
  • 1
  • 12
  • 18

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