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: {
name: 'Aaron',
age: 30
},
megan: {
name: 'Megan',
age: 40
},
aaliyah: {
name: 'Aaliyah',
age: 2
}
}
var list = function(family) {
for (var prop in family) {
var elList = document.getElementById('aaron-family').innerHTML = prop;
}
}
list(family);
And here's my HTML file
<html>
<head>
<title>Aaron's Test With Objects</title>
</head>
<li id="aaron-family">Hey, this is where it goes</li>
<footer>
<script src="objects.js"></script>
</footer>
</html>