JavaScript Array

You are Here:

What is an Array?

In general, an array is an ordered collection of elements.

In JavaScript, an array can hold multiple values of different data types in a single variable.

The following are the few examples of how an array looks like.

// Array of numbers
var arr = [1, 2, 3, 4]

// Array of strings
var arr = ["apple", "banana", "cherry"]

// Array of different data types
var arr = [1, "apple", true]

In addition to the above example, an array can hold objects, and arrays in it.

Demo

This demo holds all the car names in a single variable.

Reminder

Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author