dwhitzzz

isNumber js

Mar 21st, 2020
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * @param n value
  3.  * @returns {boolean} true if the argument is a number
  4.  */
  5. function isNumber(n) {
  6.     return !isNaN(parseFloat(n)) && !isNaN(n - 0)
  7. }
Advertisement
Add Comment
Please, Sign In to add comment