JavaScript Arrays Practice Exercises
Iteration, mapping, and array methods
Challenges
Array Index Reassignment
Array Index Reassignment
Array indexes read and write positions in an ordered list. When you assign to an...
Array Length
The `.length` property tells you how many items are currently in an array. Becau...
Push Return Value
`push` changes an array by adding an item to the end. Its return value is the ne...
Slice Range Copy
`slice` copies part of an array into a new array. The start index is included, a...
Safe Array Indexing
Array indexing returns `undefined` when a position does not exist. That can be f...
Append Without Mutation
Some array methods change the existing array, while other patterns create a sepa...
Replace Without Mutation
Replacing an array item by index is direct, but doing it on the input array chan...
Insert Into a Copy
Practice JavaScript array insertion by placing a value at a requested position i...
Remove One Matching Value
Practice JavaScript array removal by deleting only the first matching value from...
Array Type Check
Arrays are objects in JavaScript, so a broad object check cannot tell you whethe...
Chunking Arrays
Practice JavaScript array chunking by turning one list into fixed-size groups. T...
Array Rotation
Practice JavaScript array rotation by moving leading items to the end in a copie...
Deduping Without Reordering
Practice JavaScript array deduping by keeping the first occurrence of each value...
Removing a Range
Practice JavaScript array range removal by copying everything around a deleted s...
Zipping Arrays
Practice JavaScript array zipping by pairing values from two lists into nested a...
Fill Sparse Slots
Practice filling sparse JavaScript arrays by replacing missing slots without con...
Sorted Array Merge
Practice JavaScript sorted array merging by combining two already ordered number...
Moving an Array Item
Practice JavaScript array reordering by moving one item between indexes in a cop...
Sliding Window Totals
Calculate JavaScript array window totals for overlapping consecutive groups. Thi...
Consecutive Run Compression
Practice JavaScript array traversal by compressing consecutive repeated values i...
Array Intersection
Practice JavaScript array intersection by returning the unique values shared by ...
Merging Overlapping Ranges
Practice JavaScript arrays with interval merging by sorting copied range pairs b...
Applying a List Patch
Practice JavaScript array updates by applying ordered insert, remove, and replac...
Deep Flatten
Practice recursive JavaScript array flattening by walking nested lists at any de...
Cartesian Product
Practice JavaScript cartesian products by pairing every value from one array wit...
Async Sequence
Practice sequential async JavaScript over an array of task functions. This resto...