Home >Web Front-end >JS Tutorial >JavaScript method sharing for judging integers_javascript skills
There are two ways to judge integers: regular judgment and literal judgment.
Since word-by-word judgment is too inefficient, it will not be described here. Interested readers can Google it themselves.
1. Regular judgment
Effectiveness test:
http://jsfiddle.net/wzsdp9Lc/
Extended function list
2. Rounding judgment
The idea of this method is to determine whether it is equal to the original value after rounding
Effectiveness test
http://jsfiddle.net/euvn0L1g/1/