issues
search
Hetarth02
/
js-array-helpers
Array Helper functions for your quick use.
MIT License
8
stars
9
forks
source link
Added group by key helper function
#26
Closed
shailendrakanherkar18
closed
1 year ago
shailendrakanherkar18
commented
1 year ago
Added group_by_key helper function
`/**
Group by key will group data by given key
e.g i/p [
{type: 'Movie', value: 'M1'},
{type: 'TV show', value: 'TS1'},
{type: 'Movie', value: 'M2'},
{type: 'TV show', value: 'TS2'},
]
o/p
{
Movie: [
{type: 'Movie', value: 'M1'},
{type: 'Movie', value: 'M1'},
],
'TV show': [
{type: 'TV show', value: 'TS1'},
{type: 'TV show', value: 'TS2'},
]
}
@param {array of obejcts} input_arr
@param {string} key */`
Added group_by_key helper function
`/**