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

27 lines
880 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 of
localeTitle: Массив
---
## Массив
Метод Array.of () создает новый экземпляр Array с переменным числом аргументов, независимо от числа или типа аргументов.
Синтаксис:
```javascript
Array.of(element0[, element1[, ...[, elementN]]])
```
## пример
```javascript
Array.of(7); // [7] - creates an array with a single element
Array.of(1, 2, 3); // [1, 2, 3]
Array(7); // [ , , , , , , ] - creates an empty array with a length property of 7
Array(1, 2, 3); // [1, 2, 3]
```
#### Дополнительная информация:
Для получения дополнительной информации посетите [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of)