JSFiddle - React, Tailwind, and code Playground
by Richard Ayotte
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"></script>
JavaScript
console.log('hellasdf')
const input = [{
Building: 'empire'
},
{
Building: 'empire'
},
{
Condition: 'High Temp'
},
{
Condition: 'high temp'
},
{
Condition: 'high'
},
{
Condition: 'High'
},
{
Parameter: 'empireState'
},
{
priorities: 4
},
];
const result = _.groupBy(input, value => {
const [firstKey] = Object.keys(value)
console.log(value)
return firstKey
});
console.log(result)