Thuta Learning
IntermediateProgrammingbeginner

JS Arrays

Relax. We'll talk through this in plain words — no textbook voice.

Arrays are used to store multiple items in a single variable. Array methods (push, pop, forEach, map) make it easy to manage that data.

javascript
const fruits = ["Banana", "Orange", "Apple"];

// Add a new item to the end
fruits.push("Mango");

// Loop through the array
fruits.forEach(function(fruit) {
  console.log("I like " + fruit);
});
You should see
I like Banana I like Orange I like Apple I like Mango
JS Arrays | Thuta Learning