JS Built-ins
ArrayArraybeginner

Array() β€” create an empty array

πŸ“– Usage Example
const empty = new Array()
empty.length  // β†’ 0
empty         // β†’ []

Call new Array() with no arguments to create an empty array.

Array constructor

The Array constructor creates array objects. Called with no arguments, it produces an empty array identical to [].

Challenge: Implement createEmptyArray using new Array() to return an empty array.

createEmptyArray() // β†’ []
πŸ’‘ Hints (2)
  • β€’ `new Array()` with no arguments creates an empty array.
  • β€’ The result is identical to `[]`.