Important Notice:

Course Content
Switch Statement
0/1
break and continue Statements
0/3
Basic Form Validation in JavaScript
0/1
JavaScript & Angular JS (Chapter- 6) M2-R5.1
About Lesson

Data Types:-

                 JavaScript Variables मे बहुत से Data Types को hold कर सकते है जैसे Numbers, Strings, Objects आदि कई ऐसी Programming Language है जिसमे जिस Type की Value आप Variable मे Store कराना चाहते है उसी Data Type का Variable  भी Declare करना पड़ता है लेकिन JavaScript मे ऐसा नहीं है JavaScript मे आप Same Variable मे हर तरह के Data Type की Value को Store करा सकते है जावास्क्रिप्ट में दो प्रकार के data type होते हैं।

  1. Primitive Data Type

  2. Non-Primitive (reference) Data Type

 

Primitive Data Types:-

                              JavaScript मे पांच प्रकार के Primitive Data Type होते है जो निम्न हैं-

i. String data type:- String Characters के Sequence को Represents करता है जैसे “New”, “hello”.स्ट्रिंग डेटा type double quotation mark (” “) के भीतर लिखा जाना चाहिए।.

E.g. “python”, “grade”, “123.67”, “#####”.

ii. Number data type:- Number Numeric Values को Represents करता है

e.g. 234,      73.3, -15.80 etc

iii. Boolean:- Boolean, Values को Represents करता है की यह  Values False है या

iv. Undefined:- यह Undefined Values को Represents  करता है.

v. Null:- Null Values को Represents करता है और यह Check करता है की कोई भी Value नही है.

 

Non-primitive data types:-

     Non-primitive data types इस प्रकार हैं:

i. Object:- Object एक Instance को Represents करता है जिसके माध्यम से हम Numbers का उपयोग कर सकते है।

ii. Array:- Array समान प्रकार की Values को Represents करने के लिए उपयोग किया जाता है. The array index starts from 0, so that the first array element is arr[0], arr[1]

iii. RegExp:- RegExp एक Regular Expression को Represents करता है।

 

 

Data Types:-

                  Many data types can be held in JavaScript variables like Numbers, Strings, Objects etc. There are many such programming languages in which you have to declare a variable of the same data type as the value you want to store in the variable, but in JavaScript it is not like this. No, in JavaScript you can store the value of every type of data type in the same variable. There are two types of data types in JavaScript.

  1. Primitive Data Type

  2. Non-Primitive (reference) Data Type

 

Primitive Data Types:-

      There are five types of primitive data types in JavaScript which are as follows-

i. String data type:- String represents a sequence of characters such as “New”, “hello”. String data type should be written within double quotation mark (” “).

E.g. “python”, “grade”, “123.67”, “###”.

ii. Number data type:- Number represents numeric values

E.g. 234, 73.3, -15.80 etc.

iii. Boolean:- Boolean represents the values whether these values are False or True.

iv. Undefined:- It represents undefined values.

v. Null:- Represents Null Values and checks that there is no value.

 

Non-primitive data types:-

                        Non-primitive data types are as follows:

i. Object:- Object represents an instance through which we can use numbers.

ii. Array:- Array is used to represent values of similar type. The array index starts from 0, so that the first array element is arr[0], arr[1]

iii. RegExp:- RegExp represents a regular expression.

error: Content is protected !!