npm.io
1.0.1 • Published 4 years ago

grouparrayobject

Licence
ISC
Version
1.0.1
Deps
0
Size
1 kB
Vulns
0
Weekly
0

This Package will group the Array of objects on the basis of key with comma seperated values.

const grouparrayobject = require('grouparrayobject')

let arrObject = [ { "name":"Rohan", "age":12}, { "name":"Mohit", "age":22}, { "name":"Shawn", "age":18}, { "name":"Michael", "age":19}, ];

console.log(grouparrayobject(arrObject));

will output-

[ { name: 'Rohan,Mohit,Shawn,Michael', age: '12,22,18,19' } ]

Keywords