periksa javascript jika variabel adalah nomor
function isNumber(n) {
return !isNaN(parseFloat(n)) && !isNaN(n - 0);
}
TC5550
function isNumber(n) {
return !isNaN(parseFloat(n)) && !isNaN(n - 0);
}
// Another option is typeof which return a string
if (typeof(val) === 'number') {
// Guess what, it's a bloody number!
}
const checkInputIfNumber = isNaN(0924891242a)
console.log(checkInputIfNumber) //returns true