Created
November 14, 2018 09:32
-
-
Save Troland/1f05989b05a815054fc53e8f27bb096d to your computer and use it in GitHub Desktop.
isFloat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 判断是否浮点数 | |
const isFloat = (n) => { | |
return Number(n) === n && n % 1 !== 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment