Array Properties
Useful properties of arrays.
Examples
Array Length
Finding the number of items in an array.
const fruits = ["Banana", "Orange", "Apple", "Mango"];
let len = fruits.length;
console.log(len); // 4Access Last Element
Using length to access the last item.
const fruits = ["Banana", "Orange", "Apple", "Mango"];
let last = fruits[fruits.length - 1];
console.log(last); // MangoTest Your Knowledge
JavaScript Quiz
No quiz available for this topic yet.