0

In an array I have arrays of a couple of objects. I need to extract the nested object and make an array of objects.

With this code, I get the results below:

 const organicResults = data.map((item) => {
    return item.organicResults.map((result) => {
        return result.title 
    });
});

 console.log(organicResults) 

Output:

[
[
'How to Use Excel: 18 Simple Excel Tips, Tricks, and Shortcuts',
'26 Excel Tips for Becoming a Spreadsheet Pro | PCMag',
'60 Excel tips every user should master - TechRepublic',
'20 Excel Tricks That Can Make Anyone An Excel Expert',
'Work With Excel Data Like A Pro With 9 Simple Tips',

],
[
'50 Ultimate Excel Tips and Tricks for 2020 - YouTube',
'Top 25 Excel 2016 Tips and Tricks - YouTube',
'10 Best Excel Tips for Beginners - YouTube',
'MS Excel Tips & Tricks - SlideShare',
'How to Learn Excel: 5 Tips from Microsoft Training Experts',
"MrExcel's Favorite Excel Tips and Tricks Transcription – MPUG",
'Contextures Excel Tips, Excel Tutorials and Excel Examples',
'25 Microsoft Excel Tips for Beginners Who Work at Office - My ...',
]
]

I am looking for the following result:

[
'How to Use Excel: 18 Simple Excel Tips, Tricks, and Shortcuts',
'26 Excel Tips for Becoming a Spreadsheet Pro | PCMag',
'60 Excel tips every user should master - TechRepublic',
'20 Excel Tricks That Can Make Anyone An Excel Expert',
'Work With Excel Data Like A Pro With 9 Simple Tips',
'50 Ultimate Excel Tips and Tricks for 2020 - YouTube',
'Top 25 Excel 2016 Tips and Tricks - YouTube',
'10 Best Excel Tips for Beginners - YouTube',
'MS Excel Tips & Tricks - SlideShare',
'How to Learn Excel: 5 Tips from Microsoft Training Experts',
"MrExcel's Favorite Excel Tips and Tricks Transcription – MPUG",
'Contextures Excel Tips, Excel Tutorials and Excel Examples',
'25 Microsoft Excel Tips for Beginners Who Work at Office - My ...',
]
Ben Jonson
  • 181
  • 1
  • 11

0 Answers0