Arrays

Arrays are use to store ordered collections of data. If we have multiple items, then we can use arrays to store these values. Array prototype methods are used to perform mutation operations in JavaScript. There is no fixed length of an array. An array can contain multiple value types and the number of items can be mutated at any point after initialization.

Array types

There are two array types in JavaScript:

  • Nominal type: This type of array has a unique identity.
  • Structure type: This array type looks like an interface; it is also known as duck type. It uses a specific implementation of a behavior.

Note

Sparse array

In programming languages, a sparse array denotes an array that has the same values such as 0 or null. There is a large number of ...

Get Web Developer's Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.