I am working on a small React project where I am stuck at this point. I need to make a grouping based on array object key.
Below is the Array:
let addOnFeatures = [
{"name": "feature1", id: 101, cost: 100},
{"name": "feature2", id: 102, cost: 200},
{"name": "feature1", id: 103, cost: 300},
{"name": "feature3", id: 104, cost: 40}
]
I need to make a grouping based on name key so that every id related to common name should be displayed on its own tab.
Expected output should be like
*uniqueFeaturename
id: cost
Example:
1. feature1
101 : 100
103 : 300
2. feature2
102 : 200
3. feature3
104: 40