how do I find and return a specific object key and return as array in lodash.
const category = [
 { id: 123, name: "haha"},
 { id: 124, name: "haha2"},
 { id: 125, name: "haha3"},
]
how do i get this? result: [123,124,125]
how do I find and return a specific object key and return as array in lodash.
const category = [
 { id: 123, name: "haha"},
 { id: 124, name: "haha2"},
 { id: 125, name: "haha3"},
]
how do i get this? result: [123,124,125]
 
    
    make for each loop to iterate over category and each element of category has id push it into empty arr
let result = []
const category = [
    { id: 123, name: "haha"},
    { id: 124, name: "haha2"},
    { id: 125, name: "haha3"},
   ]
category.forEach(c=>{
    result.push(c.id)
})
console.log(result)
