Store ordered collections and access their elements.
- array literals
- index
- length
- push
- pop
Arrays are objects with ordered, zero-based positions. length is one more than the highest populated index, not a count of meaningful values in a sparse array. Methods such as push and pop mutate; slice creates a new array. Know when an operation changes the original.
Reading beyond the end returns undefined; sparse arrays can surprise iteration.
Build a shopping list, add and remove items, then copy it without changing the original.
Open example.html in a browser and edit example.js. Save, refresh, and use the Console and debugger to inspect values.
- Explain the core idea in your own words without reading the code.
- Change one input and predict the output before running it.
- Test one boundary or failure case, then record what you changed.