Guest User

Untitled

a guest
Jun 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. isNaN('Infinity'); // false
  2.  
  3. document.write(isNaN("")) // false
  4. document.write(isNaN(" ")) // false
  5. document.write(isNaN(0)) // false
  6. document.write(isNaN(null)) // false
  7. document.write(isNaN(false)) // false
  8. document.write("" == false) // true
  9. document.write("" == 0) // true
  10. document.write(" " == 0) // true
  11. document.write(" " == false) // true
  12. document.write(" " == 0) // true
  13. document.write(0 == false) // true
  14. document.write(" " == "") // false
  15.  
  16. " " == 0 == false
  17.  
  18. "" == 0 == false
  19.  
  20. "" != " "
  21.  
  22. alert(isNaN(parseInt(" ")));
  23.  
  24. alert(isNaN(parseFloat(" ")));
  25.  
  26. alert(' ' * 1); // 0
  27. alert('x' * 1); // NaN
  28.  
  29. var isNumber = function isNumber(value) {
  30. return typeof value === 'number' &&
  31. isFinite(value);
  32. }
  33.  
  34. function isInteger(s)
  35. {
  36. return Math.ceil(s) == Math.floor(s);
  37. }
Add Comment
Please, Sign In to add comment