The `length` Property
The length property can be used to quickly get the amount of elements in an array:
12let numbers = [5, 7, 9, 10, 15, 25, 30, 35]; console.log("There are", numbers.length, "numbers in the array.");
A property is a variable associated with an object. It represents an attribute or characteristic of that object. In this case, the length is a property of the array object, and it returns the number of elements in the array. You can access properties the same way you access methods: objectName.propertyName.
1. What does the length property of an array return?
2. What will be the output of the following code?
Дякуємо за ваш відгук!
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 1.33
The `length` Property
Свайпніть щоб показати меню
The length property can be used to quickly get the amount of elements in an array:
12let numbers = [5, 7, 9, 10, 15, 25, 30, 35]; console.log("There are", numbers.length, "numbers in the array.");
A property is a variable associated with an object. It represents an attribute or characteristic of that object. In this case, the length is a property of the array object, and it returns the number of elements in the array. You can access properties the same way you access methods: objectName.propertyName.
1. What does the length property of an array return?
2. What will be the output of the following code?
Дякуємо за ваш відгук!