0

I have next code and there is a result I have to get, get all the ids in separate array(it would be better to use array methods for me):

const arr = [{id: 1, name: "John"},{id: 2, name: "Maria"},{id: 3, name: "Sheldon"}];
const arr2 = [{id: 4, name: "John"},{id: 5, name: "Maria"},{id: 6, name: "Sheldon"}];
const arr3 = [{id: 7, name: "John"},{id: 8, name: "Maria"},{id: 9, name: "Sheldon"}]
const result = [1, 2, 3, 4, 5, 6, 7, 8, 9];
Max
  • 79
  • 5
  • Welcome to Stack Overflow! Visit the [help], take the [tour] to see what and [ask]. Please first ***>>>[Search for related topics on SO](https://www.google.com/search?q=javascript+extract+id+from+object+array+site%3Astackoverflow.com)<<]`](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Dec 14 '21 at 10:13

0 Answers0