About 529,000 results
Open links in new tab
  1. JavaScript Arrays - W3Schools

    There is no need to use new Array(). For simplicity, readability and execution speed, use the array literal method. You access an array element by referring to the index number: Note: Array …

  2. Array () constructor - JavaScript - MDN

    Oct 4, 2023 · Arrays can be created using a constructor with a single number parameter. An array is created with its length property set to that number, and the array elements are empty slots.

  3. javascript - Array () vs new Array () - Stack Overflow

    Nov 13, 2018 · When Array is called as a function rather than as a constructor, it creates and initialises a new Array object. Thus the function call Array(…) is equivalent to the object …

  4. JavaScript Arrays - GeeksforGeeks

    Feb 10, 2025 · In JavaScript, an array is an ordered list of values. Each value is called an element, and each element has a numeric position in the array, known as its index. Arrays in …

  5. JavaScript Arrays - How to Create an Array in JavaScript

    May 16, 2022 · In this article, I will show you 3 ways you can create an array using JavaScript. I will also show you how to create an array from a string using the split() method.

  6. Arrays - The Modern JavaScript Tutorial

    Jun 8, 2024 · The call to new Array(number) creates an array with the given length, but without elements. The length property is the array length or, to be precise, its last numeric index plus …

  7. How to Declare and Initialize an Array in JavaScript - W3docs

    JavaScript allows declaring an Array in several ways. Let's consider two most common ways: the array constructor and the literal notation. The new Array () Constructor The Array () …

  8. JavaScript new Array Method - W3Schools

    The new Array() constructor creates an Array object. Required. An iterable object with values. A new Array object. Create an empty array and add values: Create an array without the new …

  9. Array - JavaScript | MDN

    Apr 3, 2025 · This example shows three ways to create new array: first using array literal notation, then using the Array() constructor, and finally using String.prototype.split() to build the array …

  10. What is the way of declaring an array in JavaScript?

    It actually creates an array of size 5 (all elements undefined), assigning it to the variable a, and then immediately throws that array away and assigns to the variable a another, brand new …

  11. Some results have been removed
Refresh