DEV Community

Abinaya V
Abinaya V

Posted on

Array in java script

In JavaScript,an array is an ordered collection of values. Unlike some other languages, JavaScript arrays are dynamic (their size can change) and can hold a mix of different data types, such as numbers, strings, and even other arrays.

Creating Arrays

The most common way to create an array is using array literal notation with square brackets []. 
Enter fullscreen mode Exit fullscreen mode
  • Empty Array: let fruits = [];

  • With Elements: let fruits = ["Apple", "Banana", "Cherry"];

Simple Definition for array:

An array in JavaScript is a special variable used to store multiple values in a single variable.

An array holds a list of items (like numbers, strings, objects, etc.) in an ordered way.

Top comments (1)

Collapse
 
payilagam_135383b867ea296 profile image
Payilagam

1) Write in your own words
2) Add References