jskatas.org Continuously Learn JavaScript. Your Way.

Array API: Array.of()

Array.of() creates an array with the given arguments as elements.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

Array.of creates an array with the given arguments as elements

  • dont mix it up with Array(10), where the argument is the array length
  • puts all arguments into array elements
  • takes any kind and number of arguments