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.
Press Submit to check your solution.
Back to lesson: Practice: Destructuring & Spread — Practice