Skip to content

Instantly share code, notes, and snippets.

@Troland
Created November 14, 2018 09:32
Show Gist options
  • Save Troland/1f05989b05a815054fc53e8f27bb096d to your computer and use it in GitHub Desktop.
Save Troland/1f05989b05a815054fc53e8f27bb096d to your computer and use it in GitHub Desktop.
isFloat
// 判断是否浮点数
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