• Return a copy of the object only containing the whitelisted properties.

    var foo = { a: 1, b: 2, c: 3 };
    var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }

    Parameters

    • obj: any

      the source object

    • propNames: any

      an Array of strings, which are the whitelisted property names

    Returns {}