Challenge 1
Transform every score by doubling it.
const result = [2, 4, 6].map(value => value * 2);
Press Ctrl⌘Enter to check your answer
Practice transformations, selection, reduction, searching, non-mutating edits, materialization, and grouping with JavaScript arrays.
Challenge 1
const result = [2, 4, 6].map(value => value * 2);
Press Ctrl⌘Enter to check your answer
Challenge 2
const result = records.filter(record => record.active);
Press Ctrl⌘Enter to check your answer
Challenge 3
const total = prices.reduce((sum, price) => sum + price, 0);
Press Ctrl⌘Enter to check your answer
Challenge 4
const result = values.findLast(value => value > 10);
Press Ctrl⌘Enter to check your answer
Challenge 5
const sorted = values.toSorted((a, b) => a - b);
Press Ctrl⌘Enter to check your answer
Challenge 6
const next = states.with(1, "done");
Press Ctrl⌘Enter to check your answer
Challenge 7
const values = Array.from(new Set([1, 2, 3]));
Press Ctrl⌘Enter to check your answer
Challenge 8
const groups = Object.groupBy(products, product => product.category);
Press Ctrl⌘Enter to check your answer