JavaScript Array of() method
creates a new Array instance from a variable number of arguments, regardless of number or type of the arguments

Array.of() method creates a new array from any number of arguments.

syntax

of(element1, element2, /* …, */ elementN)

element1, …, elementN elements used to create the array..

Array.of() method can take any type of argument.

Array.of() method returns a new Array instance.

Array.of() returns the modified array.

The difference between Array.of() and the Array() constructor is in the handling of single arguments:

Array.of(7) creates an array with a single element [7]

Array(7) creates an empty array with a length property of 7 [empty x 7]

syntax description
create a new Array instance from a variable number of arguments
Array.of(element1, element2, ..., elementN)