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.
View attachment 1277
In this example we only initialize...
Arrays In JavaScript
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