New:Embedded & IoT Bootcamp
Exercise Level: IntermediateDuration: 30 minLanguage: JavaScript

Array Methods Workout

Ten practical tasks that drill map, filter, reduce, sort and flatMap against realistic data.

Abhishek Sharma 2026-08-11 Programming / JavaScript

Setup

You are given an array of order objects with id, customer, total and status fields.

Tasks

  1. Return only shipped orders.
  2. Compute revenue for each customer.
  3. Find the highest-value order without mutating the source array.
  4. Group orders by status.
  5. Produce a flat list of line items across all orders.

Rules

Prefer pure functions. Avoid for loops unless the task explicitly benefits from early exit.

Want more like this?

Browse every exercises in the library, organised by topic.

All exercises

Related learning

Tutorial2026-06-09

Data Types

Deep dive into JavaScript data types: numbers, strings, arrays, and array methods

Programming / JavaScript

JavaScriptData Types
Tutorial2026-06-09

An Introduction to JavaScript

Learn what JavaScript is, its history, and how to get started with tools and the developer console

Programming / JavaScript

JavaScriptProgramming
Tutorial2026-06-09

JavaScript Fundamentals

Master the basics: Hello World, code structure, variables, data types, and type conversions

Programming / JavaScript

JavaScriptProgramming