Skip to main content

Practice ยท 1 of 3

Pick Fields

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.

Difficulty: intermediate

Back to lesson: Practice: Destructuring & Spread โ€” Practice