Horje
What is an Array in JavaScript ?

In JavaScript, an array is a data structure used to store multiple values of any data type sequentially. Arrays allow you to group together related data items under a single variable name. Each value in an array is called an element, and each element is accessed by its index, starting from 0.

Example: Here, the variable numbers is assigned an array containing five numeric elements [1, 2, 3, 4, 5]. The elements are enclosed within square brackets ([]) and separated by commas. Each element has a numeric value, and they are stored sequentially in the array.

Javascript

let numbers = [1, 2, 3, 4, 5];
console.log(numbers); // Output: [1, 2, 3, 4, 5]

Output

[ 1, 2, 3, 4, 5 ]



Reffered: https://www.geeksforgeeks.org


JavaScript

Related
What is the use of the Array.sort() method in JavaScript ? What is the use of the Array.sort() method in JavaScript ?
What is the use of && operator in JavaScript ? What is the use of && operator in JavaScript ?
What is the use of the += operator in JavaScript ? What is the use of the += operator in JavaScript ?
What are Comparison Operators in JavaScript ? What are Comparison Operators in JavaScript ?
Difference between Function Declarations & Function Expressions in JavaScript Difference between Function Declarations & Function Expressions in JavaScript

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
14