Syntax: It is used to set the array length.
array.length = number
It returns the length of the array.
Return Value: It returns a numerical value, denoting the number of elements in the array object
Below is an example of the Array length property.
Example: This example returns the length of the array.
let colors = [
More example codes for the above property are as follows:
let arr =
let arr =
Array(5, 10, 15);
- Google Chrome 1 above
- Edge 12 and above
- Firefox 1 and above
- Internet Explorer 4 and above
- Opera 4 and above
- Safari 1 and above
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses
are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!