Underscore.js | _.pick() Function
The _.pick() function is used to return a copy of the object that filtered using the given key. This function accepts a predicate indicating which keys are picked from the object.
Parameters: This function accept two parameters as mentioned above and described below:
- object: This parameter holds the value of an object.
- keys: It is an optional parameter. It contains the key name that value need to be picked.
Return Value: It returns a copy of the object that filtered using the given key.