Utilizor
Contact Us

Array Properties

Useful properties of arrays.

Array Properties

The length property of an array returns the length of an array (the number of array elements).

let length = cars.length;

Accessing the Last Array Element:

let last = cars[cars.length - 1];

Example

const fruits = ["Banana", "Orange", "Apple", "Mango"];
let length = fruits.length;