Deviopath › JavaScript

Pick Keys

Medium · Objects

Write a function pick that returns a new object with only the properties of obj whose names are listed in keys.

Ignore names in keys that do not exist in obj.

Next: Invert an Object