Data Types in Hindi

Data Types In JavaScript In Hindi

JavaScript

Data Types In JavaScript In Hindi:- Javascript Programming Me 2 Type Ke Data Type Hote Hai | 1.Primitive Data Types And 2. Reference Data Types Hote Hai |

Data Types In JavaScript In Hindi

Jab Bhi Aap Kisi Value Ko Store Karne Ke Liye Variable Create Karte Hai To Aap Sath Hi Us Variable ka Data type Bhi Define Karte Hai | Data Type Se Compiler Ko Ye Pta Chalta Hai Ki Is Variable Mei Kis Type Ka Data Store Kiya Jayega |

Also Read – JavaScript Variables

JavaScript Supports Two Classes of Data Types

  1. Primitive Data Types – Ye Wo data types Hote Hai Jo Jyadatar Sabhi programming languages Mai Paye Jate Hai And Iska Memory Allocation Stack Me Hota Hai Or Stack Static Memory Hoti hai |
  2. Reference Data Types – JS Aapko data type create Karne Ki capabilities provide Karti Hai And Iska Memory Allocation Heap Me Hota Hai Or Heap Dynamic Memory Hoti hai ।

Also Read – Data Structure And Algorithms Tutorial

Inhe Ham Ek Karke Understand Karte Hai |

Primitive Data Types In Js In Hindi

Primitive Data Types me 4 Data type Aate Hai Inhe Ham Ek List Se Understand Karte Hai |

  1. String
  2. Number
  3. Boolean
  4. Undefined

String – Primitive Data Types In JS In Hindi

String Characters Ka Collection Hota Hain And Ek String Koi Tarah Ke Characters Se Bani Ho Sakti Hain. String Main Numbers Nhi Aate Hain And Jo Data Type Bina Number ke Word Main Istemal Ki Jati Hai Use Hi String Data Type Kahte Hain. String Ko “Double Quotes” And ‘Single Quotes’ Ke Under Likhi Jati Hain.

For Example:

var str1 = 'Master';  //Single quoted string
var str2 = " Programing"; //Double quoted string
var str3 = "";       //Empty String

document.write("Value of str1 : " + str1 + "<br />");
document.write("Value of str2 : " + str2 + "<br />");
document.write("Value of str3 : " + str3 + "<br />");

Output:

Value of str1 : Master
Value of str2 : Programing
Value of str3 :

Number – Primitive Data Types In JS In Hindi

Number Data Type Non Decimal And Decimal Number Hote Hain And Non-Decimal Ka Matlab Hota Hain Jin Numbers Main Kabhi Decimal Nhi Aati Hain. Number Data Type Positive And Negative Bhi Hote Sakte Hain |

For Example:

var a = 15;    //Integer Numeric value
var b = 1.10; //Floating-point Numeric value
var c = -10;   //Negative Integer Numeric value
var d = -5.80; //Negative Floating-point Numeric value

document.write("Value of a is " + a + "<br />");
document.write("Value of b is " + b + "<br />");
document.write("Value of c is " + c + "<br />");
document.write("Value of d is " + d + "<br />");

Output:

Value of a is 15
Value of b is 1.10
Value of c is -10
Value of d is -5.80

Boolean – Primitive Data Types In JS In Hindi

Boolean Data Type 2 Status Ko Represent Karta Hain Ya to TRUE ya FALSE | Boolean Se Matlab true and false Se Hota Hain Jisme Ya to Value True Hoti hai ya False |

For Example:

var a = true;    
var b = false;

Boolean Ke Baren Main Aage Ke Chapter Or Deeply Read Karne Walen Hain.

Undefined – Primitive Data Types In JS In Hindi

Variable Ko Jab Declare And initialize Kiya Jata To Undefined Data Types Hota Hai |

Also Read – JS Variables

Example:

var a = undefined;    
document.write("Value of a is " + a + "<br />");

Output:

Value of a is undefined

Reference Data Types In Js In Hindi

Reference Yani Objects Data Types me 4 Data type Aate Hai Inhe Ham Ek List Se Understand Karte Hai |

  1. Null
  2. Array
  3. Function
  4. Object

Null – Reference Data Types In JS In Hindi

Null Variable Ek Tarah Ka Variable Hota Hain Jise Koi Value Nhi Di Jati Hain And Null Ek Special Data Type Hain Jiski Keval Ek Hi Value Hoti Hain |

Example:

var a = null;
document.write(a==undefined);

Output:

true

Array – Reference Data Types In JS In Hindi

Array Ek Same Data Items Ka Ek Collection Hain. Array Ka Istemal Bahut Sare Data Values Ko Ek Variable Main Store Karne Main Kiya Jata Hain | Array Ke Under Ham Multiple Data Ko Aashani Se Store Kar And Uska Istemal Kar Sakte Hain |

For Example:

var arr = [1, 2, 3, 4, 5];

document.write("arr[0] : " + arr[0] + "<br />");
document.write("arr[1] : " + arr[1] + "<br />");
document.write("arr[2] : " + arr[2] + "<br />");
document.write("arr[3] : " + arr[3] + "<br />");
document.write("arr[4] : " + arr[4] + "<br />");

Output:

arr[0] : 1
arr[1] : 2
arr[2] : 3
arr[3] : 4
arr[4] : 5

Array Ki Index Position 0 Se Start Hoti Hai.

Function – Reference Data Types In JS In Hindi

Function Line of code ya subprogram Hota hai Inka Ek group Hota Hai Chota program ka us program Me Kitni Bhi Code line ho Sakti Hai or Inka Aapna Ek name & Features Hota Hai Or Function ko Aap Program me Kahi Bhi Call Ya Dobara Istemal Kar Sakte Hai |

Example:

function func(){
var a = 10;
	document.write("Value of a is " + a);
}
func();

Output:

Value of a is 10

Objects – Reference Data Types In JS In Hindi

JS Object Ek Type ka Data Hain Jo Ki Data Or Information Ko Store Karke Rakhta Hain Jiske Duvara Function Ki Functionality Ko Access Kiya Ja Sakta Hain |

Also Read – JS Comments

For Example:

var Employee = {
	id  :  1,
	name : "Danish Ali",
	salary : 25000
};
document.write( Employee.id + "<br />");
document.write( Employee.name + "<br />");
document.write( Employee.salary + "<br />");

Output:

1
Danish Ali
25000

Friends Mujhe Umeed Hai Ki Aapko Js Data Types In Hindi Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *