डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

Full Stack Web Development with Laravel

Full Stack Web Development with Laravel

Affiliate Program

Affiliate Program

Array in java script

 
Collection of data is called an array.
 
There are two types of an array.
 

Single dimension array

syntax:
var array_name=[n1, n2,...];
 
example
var marks=[10,20,30,40,50];

Calculate size of an array

console.log(marks.length)
 

Multi dimension array

 
syntax
 
var array_name=[
[n1, n2, ....],
[m1, m2, ....]
];
 
example
var person=[
["Rama", 20, "Almora"],
["Krishna", 20, "Nainital"]
  ];
© 2016 - 2023, All Rights are Reserved.