JavaScript Data types

0

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.

Example:

(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:

RELATED TOPICS

Share.

About Author

Hey TLOGER..!! I'm Sanjeev an "Engineer By Innocence" and the person behind this website. I started blogging with passion and I'm enthusiastic about technology and its related stuff. That's how journey towards TLOGER (TECHIE - BLOG - READERS) began.

Leave A Reply