score:0

static isInt(value: any) 
{       
       var check = parseFloat(value)       
       console.log(typeof check)  

       return check

}

score:3

const isNumber = (number) => Number.isFinite(number);

let num = 4;
console.log(`${num} is a number: ${isNumber(num)}`);
num = 4.54;
console.log(`${num} is a number: ${isNumber(num)}`);
num = 'a';
console.log(`${num} is a number: ${isNumber(num)}`);

// 4 is a number: true
// 4.54 is a number: true
// a is a number: false

Related Query

More Query from same tag