Hello,
I am a beginner in Javascript (and programming) and am tasked with creating a function that will convert an array of objects into an array of arrays.
I have one array with many objects inside , which consist of movies and their data such as genres, actors, descriptions etc.
I need to create a function which will convert this array of objects :
var movieInfo = [
{....
actors: [
{ firstName: "Elijah", lastName: "Wood" },
{ firstName: "Ian", lastName: "McKellen" },
{ firstName: "Viggo", lastName: "Mortensen" }
]
}
]
to an array of arrays and then log the actors names to the console.
I've tried using Array.from() method but as i don't really understand it yet it hasn't done the trick.
Thank you in advance.
What I have tried:
loop through the array, and tried Array.from on the objects within the array