Data types are used to store different values in the variable.
JavaScript is a dynamic or loosely-typed language because a variable can hold value of any data type.
JavaScript is a dynamic or loosely-typed language because a variable can hold value of any data type.
Types:
There
are two types of data types in JavaScript.they are
1)primitive
data types
2)non-primitive data types
primitive data types
1. String
2. Number
3. Boolean
4. Null
5. Undefined
non-primitive data
types
1.
Object
2.
Date
3. Array
Example:
var x=40;//holding number
var y="Rahul";//holding string
varz
=
true;
//holding boolean
var b
=
null;
//holding null
var a
= undefined;
//holding undefined
No comments:
Post a Comment