array in javascript

array in javascript

array is used to store multiple values, and all the values must be in same data type.

Syntax

Example

Try Yourself

Access particular array value

We can access the array value by using its index value.

Index value starts from 0.

Example

Try Yourself

Change array value

We can change the specific array value using its index value.

Example

Try Yourself

Read array value using for loop

We can read all the array values also by using for loop.

To do it length of the array must be known, it can be found using length property.

Example

Try Yourself