HomeChallengesRepsProblemsLeaderboardTake a challenge

The Wiped Field

Someone changed an order status and the delivery note vanished. The client only sent status. Work out the difference between "not sent" and "sent as empty".

Beginner15 min on the clock5 graded checks · 100 pointsThe Write Side
Graded by running your code against real cases.

What you build

  • applyPatch(row, patch) — a field that was not sent is left alone
  • A field sent as null IS cleared. Those are different instructions
  • replace(row, next) — PUT semantics: what you did not send is gone
  • patchRow(rows, id, patch) — update one row in a list
  • changedFields(row, patch) — what would actually change

Done means

A patch of one field changes exactly one field, and null still clears.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. A field that was not sent is left alone+25Patch versus replace
  2. null clears the field, undefined does not+25Patch versus replace
  3. replace drops what was not sent+20Patch versus replace
  4. patchRow updates one row and copies the rest+20Not mutating your inputs
  5. changedFields ignores a patch that changes nothing+10Patch versus replace

What it teaches

The rest of The Write Side