When I attempt this, the HMTL page only displays the last object, instead of all the objects.
Here is my JavaScript file
var family = {
aaron: {
n
This dynamic way to render like this data format into HTML
const elList = document.getElementById('aaron-family')
function convertObjectsToArrayOfObjects(family) {
const filteredData = []
for(person in family){
filteredData.push(family[person])
}
return filteredData;
}
function elList(family) {
const familyData = convertObjectsToArrayOfObjects(family)
elList.innerHTML = `
${
familyData.map(person => {
return `
name: ${person.name}
age: ${person.age}
`
})
}
`
}
list(family);