I was helping someone with this lesson, and they found it confusing when creating the displayPopulation function, as the first variable was named the same as the object key they needed to reference.
var london = {
name: 'London',
population: 8308369,
// ...
}
function displayPopulation() {
var population = document.createElement('p');
// ...
}
I've changed the variable name from "population", to "paragraph".
This helps the next line read nicer too; "append content to paragraph", rather than "append content to population"
Hey,
I was helping someone with this lesson, and they found it confusing when creating the
displayPopulation
function, as the first variable was named the same as the object key they needed to reference.I've changed the variable name from "population", to "paragraph".
This helps the next line read nicer too; "append content to paragraph", rather than "append content to population"