Skip to main content

Practice · 1 of 3

Pick Fields

CHALLENGE
Difficulty: intermediate+25 XP

Write pick(obj, keys) that RETURNS a new object containing only the properties listed in keys that actually exist on obj. Missing keys are skipped, the input object must never be mutated, and each call returns a fresh object.

Back to lesson: Practice: Destructuring & Spread — Practice