Friday 30 March 2018

Data types In JavaScript

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.
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  
var  z= true; //holding boolean
var  b= null; //holding null
var  a= undefined; //holding undefined
 

 

No comments:

Post a Comment

apply function in R

1) apply function: It takes 3 arguments matrix,margin and function.. Example: m<-matrix(c(1,2,3,4),nrow=2,ncol=2) m #1 indicates it is ap...