Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

Arrays In JavaScript

$
0
0
An array is a collection and it is zero-indexed. The meaning of this is the first element is at index zero and the last element is at an index of array length -1 position.

The array in JavaScript has length property which returns the size of that array.


Code:
var array = [];
console.log("Array Length -- "+ array.length);

View attachment 1277



Code:
var array = new Array(100);
console.log("Array Length -- "+ array.length);


In this example we only initialize...

Arrays In JavaScript

Viewing all articles
Browse latest Browse all 1987

Trending Articles