JavaScript Data Types and Variables

data types of javascript is:-
String,boolean,object,number,array
variables of javascript:-
var pi=3.14;
var person="John Doe";
var answer='Yes I am!';
 
data type is defined as the type of data which is used for the values of the input which is given in the program String, bool, object, numeric , array are the data type of java. variables of javascript are var pi, var person, var answer.
 
JavaScript variables can hold many data types: numbers, strings, arrays, objects and more:

var length = 16; // Number
var lastName = "Johnson"; // String
var cars = ["Saab", "Volvo", "BMW"]; // Array
var x = {firstName:"John", lastName:"Doe"}; // Object
 
Back
Top