This repository contains an interactive learning activity focused on JavaScript arrays. The exercises will help you practice fundamental array methods and operations, including adding, removing, and modifying elements.
- index.html – A simple HTML file that links to the JavaScript files.
- array-exercises.js – A collection of 10 exercises covering essential JavaScript array methods.
- practice-problem.js – A word problem requiring array manipulation to reinforce the concepts learned.
- Clone or download this repository.
- Open
index.htmlin your browser. - Open the browser console (right-click → Inspect → Console) to see the output of the exercises.
- Modify the JavaScript files as needed to experiment with array methods.
.push()– Adds an element to the end of an array..pop()– Removes the last element of an array..unshift()– Adds an element to the beginning of an array..shift()– Removes the first element of an array..length– Returns the number of elements in an array..join()– Converts an array into a string with a specified separator.- Accessing elements using indexes (e.g.,
array[0]for the first element).