declare size array javascript code example
Example 1: javascript size array
let array = [1, 2, 3];
console.log(array.length);
Example 2: create array initialize size javascript
const array = new Array(4);
array.length //4
let array = [1, 2, 3];
console.log(array.length);
const array = new Array(4);
array.length //4