You are on page 1of 9

ARRAY

in Javascript
Lesson Flow
1. What is an Array?
2. How to declare an Array?
3. How to access Array Elements?
4. Replace Array Element
5. Add Element into an Array
6. Additional Knowledge about Array
Array
is an ordered list of values. Each value is called an
element specified by an index. An JavaScript array
has the following characteristics: First, an array can
hold values of mixed types. For example, you can
have an array that stores elements with the types
number, string, and boolean.
Declaring Array
1. Var ArrayName = new Array();
2. Var ArrayName = [ ];
Accessing Elements of an Array
Replacing an Element of an Array

fruits[2] = “Pear”
Add an Element of an Array

Fruits[3] = “Lemon”
Additional knowledge
about an Array

- Trailing comma
- Methods pop/push, shift/unshift
Thank You for watching

You might also like