1// The first 2 Variations return a Boolean
2// They just work the opposite way around
3
4// IsInteger
5if (Number.isInteger(val)) {
6 // It is indeed a number
7}
8
9// isNaN (is not a number)
10if (isNaN(val)) {
11 // It is not a number
12}
13
14// Another option is typeof which return a string
15if (typeof(val) === 'number') {
16 // Guess what, it's a bloody number!
17}
1// Another option is typeof which return a string
2if (typeof(val) === 'number') {
3 // Guess what, it's a bloody number!
4}