Check if variable is a number in JavaScript. This tutorial explains how to check variable is a number in javascript. Lets see the below example, where we have used typeof operator and isNaN() function to verify the variable is number or not. typeof – If variable is a number, it will returns a string named "number". isNaN() – Stands for "is Not a Number", if variable is not a number, it return true, else return false.