P3.4: JS Arrays & Basic Methods

Arrays store ordered lists of data.


1. Array Fundamentals

Arrays are declared using square brackets:

const skills = ["HTML", "CSS", "JS"];
console.log(skills[0]); // HTML
  • push(): Add item to end of array.
  • pop(): Remove item from end.
  • length: Count elements.
Addy Osmani

Addy OsmaniView Profile ๐Ÿ”—

Real-World Developer Case Study
13 Years Exp
RoleEngineering Manager, Chrome Dev
Salaryโ‚น95 Lakhs/yr equivalent
CompanyGoogle
Core Tech Stack
Chrome V8 PerformanceWeb Developer Patterns

โ€œUnderstanding array data structures and performance memory layouts inside engines like V8 is critical when working with massive data sets in JavaScript.โ€


๐ŸŽ“ Practice Assignment Tasks

  • Create an array of 3 hobbies.
  • Push a new hobby.
  • Pop the last item.
  • Log the final array and length.
Stuck? Hints available
// Write your JavaScript logic here
// Click 'Run Code' to see console outputs below
๐Ÿ”’ Code requirements not met yet. Complete the tasks above.
๐Ÿ”’ Complete the Practice Assignment above to unlock completion.
Advertisement
NS
Ask Nextsem
AI Mode
NS
Home
Course
Playground