.length property provides the length or size of an array, which represents the number of elements it contains. This property is read-only, meaning that you can't assign a value to it directly.
In the above example, the array
fruits contains three elements, so the value of
fruits.length is 3.
Print the length of the
myArray using the
.length property to the console.
Sign up to start coding
Already have an account?