how to check value is of required type in javascript code example Example: check data type in javascript typeof("string"); //string typeof(123); //number