Answers for "how to get only ids from the array of object"

3

js get object by id from array

myArray.find(x => x.id === '45');
Posted by: Guest on February-05-2021
0

extract data from object when it match with array of ids js

const keep = new Set(['id4', 'id2']);

 const result = [];

 for(const items of Object.values(data.items))
   for(const item of items)
     if(keep.has(item.id))
       result.push(item);
Posted by: Guest on July-27-2020

Code answers related to "how to get only ids from the array of object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language