Put in order · JavaScript and TypeScript course · Module 12: Functional Programming
Immutable Array Update Syntax
Arrange the elements of an immutable array element update:
Items to put in order
- const updated =
- item.id === targetId ?
- items.map(item =>
- { ...item, value: newVal } : item)
You can check the correct answer by solving this task in the CodeWorlds game.