I need to compare the key of an object in an array, I need to group based on the key value
const days = [
{'name':'Mon','value':1},
{'name':'Tue','value':5},
{'name':'Wed','value':10},
{'name':'Wed','value':30},
{'name':'Fri','value':18},
{'name':'Sat','value':80},
{'name':'Sat','value':90},
{'name':'Sun','value':20},
]
I need to group like this
const result [[1],[5], [10, 30], [18], [80, 90], [20]]
I am very new to javascript, I am not going to do this. if its possible in lodash - es6, everything will be fine.
source
share