653 B
653 B
title |
---|
Array of |
Array of
The Array.of() method creates a new Array instance with a variable number of arguments, regardless of number or type of the arguments.
Syntax:
Array.of(element0[, element1[, ...[, elementN]]])
Example
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]
More Information:
For more information visit MDN