const subject = [
['name', 'Math'],
['score', 90],
['dept', 'Mathematics']
];
const subject_obj = _.fromPairs(subject);
// => { "name": "Math", "score": 90, "dept": "Mathematics"}
_.fromPairs(pairs_array);
pairs_array: [Required] You can pass the paired array into this parameter. In the code snippet subject is our paired array.
0 Comments