JSFiddle - React, Tailwind, and code Playground
by Matthew Day
JavaScript
const persons = [
{
name: 'Anna',
hobbies: [
{
type: 'Camping',
rating: 3
},
{
type: 'Fishing',
rating: 4
},
{
type: 'Hiking',
rating: 5
}
]
},
{
name: 'Billy',
hobbies: [
{
type: 'Hugging',
rating: 3
},
{
type: 'Kissing',
rating: 4
},
{
type: 'Touching',
rating: 5
}
]
},
{
name: 'Carlos',
hobbies: [
{
type: 'Learning',
rating: 3
},
{
type: 'Reading',
rating: 4
},
{
type: 'Studying',
rating: 5
}
]
}
]
const someFn = () => {
return persons.map((person, pindex) => {
return person.hobbies.map((hobby, hindex) => {
console.log(hobby);
});
})
}
someFn()