JavaScript Data types


JavaScript Data types

JavaScript Data types can be classified mainly into four types. They are,

  1. Boolean data type
  2. String data type
  3. Null data type
  4. Number data type.

Boolean Data Type : This data type consists of two logical values,

  • True
  • False

Example :  var snowing = false // Here var is a Boolean data type where it displays the value false.

String Data Type : In this data type of JavaScript, information is written in double quotes.

Example of few String Data Type

(i) var name = “Hey TLOGER” :- Here var is a String data type which displays Hey TLOGER.

(ii) var greeting = “Hello” :- Var displays Hello.

Null Data Type : The user can use this data type when he/she feels it does not want to initialize the value of a particular variable.


(i) var emp no = null;

(ii) var age = null;

Number Data Type : This data type is just the opposite of String data type. The value is declared without double quotes.

Example of a number data type,

(i) Var n1 = 30;

‘(ii) var rate = 800;

(iii) var amount = 9000;

(iv) var num = 50;

(v) var atv = 65.75:



Leave A Reply