You need Login/Signup to run/submit the code.
Implement lodash.pick from scratch | Problem Solving | Frontend Interview Question
@Yomesh Gupta
In this question, the candidate must replicate the functionality of _.pick
from lodash.
Syntax:
_.pick(object, [paths])
Arguments:
object (Object): The source object.
[paths] (...(string|string[])): The property paths to pick.
pick
method creates an object composed of the picked object
properties.
var object = { 'a': 1, 'b': '2', 'c': 3 };
_.pick(object, ['a', 'c']);
// => { 'a': 1, 'c': 3 }