SkillSeevaSkillSeeva
HomeResourcesScheduleRoadmapTeam
Back to Categories
Current Path
JavaScript
Syntax & VariablesOperatorsFunctionsObjectsEventsString MethodsArrays & MethodsDate & MathLogic (If/Switch/Loops)DOM ManipulationES6+ FeaturesScope & HoistingThe 'this' KeywordJS ModulesClassesAsync/Await & PromisesDebuggingWeb APIs (Fetch, Storage)JSON
Jump to topic:
Syntax & VariablesOperatorsFunctionsObjectsEventsString MethodsArrays & MethodsDate & MathLogic (If/Switch/Loops)DOM ManipulationES6+ FeaturesScope & HoistingThe 'this' KeywordJS ModulesClassesAsync/Await & PromisesDebuggingWeb APIs (Fetch, Storage)JSON

Arrays & Methods

Arrays are used to store multiple values in a single variable.
javascript
const fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.push("Lemon"); // Adds new element

// Iteration
fruits.forEach((value) => {
  console.log(value);
});

// Map (Returns new array)
const numbers1 = [45, 4, 9, 16, 25];
const numbers2 = numbers1.map(myFunction);
7 / 19