2. What is an Array?
• It stores multiple values and elements in one variable. These values can be of
any data type — meaning you can store a string, number, Boolean, and other
data types in one variable.
• Example :
• const array_name = [item1, item2, ...];
Reference
name Element
3. Array Indexing
• The index indicates the position of the element within the array (starting from 0) and is either a
number or a field containing a number.
• You access an array element by referring to the index number
• Syntax :-
const array_name = [item1, item2, ...];
Index 0 index 1 ….
<value> = <array>[index]
4. Array Properties
• The .length property :-
One of an array’s built-in properties is length and it returns the number of
items in the array. We access the .length property
Syntax: array_name.length
5. Array Operations
• Overview of common array operations: Adding elements: push(),
unshift(),
• Removing elements: pop(), shift()
• Modifying elements: assignment via index
• Concatenation: concat()
• Joining elements: join()
• Sorting elements: sort()
• Reversing elements: reverse()