Skip to content
Advertisement

Javascript Mapping Array of Objects within an Array

I know there have been some similar questions before but I’m really stuck on trying to map the below array of information (I’ve tried to implement several example). I have an Array with two information fields and a third field that contains Arrays of objects. I want to extract the name of each of the objects into the original name so that my output looks like the below:

Desired Output:

JavaScript

Below is a sample of what the data looks like:

JavaScript

The [Object] has a property called gameGenre that I want to store in the original array as an array instead of as an Array of Objects.

My most recent attempt was:

JavaScript

I appreciate any help anyone can add!

Thanks!!

Advertisement

Answer

I think this is what you want:

JavaScript
Advertisement