Files
freeCodeCamp/guide/russian/javascript/standard-objects/array/array-length/index.md
2018-10-16 21:32:40 +05:30

26 lines
981 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Array Length
localeTitle: Длина массива
---
## Длина массива
`length` - свойство массивов в JavaScript, которое возвращает или задает количество элементов в заданном массиве.
Свойство `length` массива может быть возвращено так же.
```js
let desserts = ["Cake", "Pie", "Brownies"];
console.log(desserts.length); // 3
```
Оператор присваивания в сочетании с свойством `length` может использоваться для установки количества элементов в массиве, подобном этому.
```js
let cars = ["Saab", "BMW", "Volvo"];
cars.length = 2;
console.log(cars.length); // 2
```
#### Дополнительная информация:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Array/length