Answers for "if js variable is integer"

18

javascript is number an integer

Number.isInteger(value)

//returns a Boolean
Posted by: Guest on January-18-2020
0

check if a variable is a number in javascript

// as test cases we have two variables of which 1 is a number and the second one is a string
let x = 7;
let y = "hello"
let result1 = !Number.isNaN(x) // true
let result2 = !Number.isNaN(y) // flase
Posted by: Guest on June-01-2021

Code answers related to "if js variable is integer"

Code answers related to "Javascript"

Browse Popular Code Answers by Language