Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How javascript determines whether a value is an integer,
How javascript determines whether a value is an integer,
Whether the value after integer conversion by parseInt is equal to the original value.

Example:

var? a = 123;

If(parseInt(a)==a){// Converts the value of variable A through parseInt, and then compares it with A itself. If it is an integer, the two are consistent; If it is not an integer, the two are inconsistent.

//is an integer.

} Otherwise {

//is not an integer

} added:

ParseInt: means to round the value.