Skip to content

Conversation

@IvanCastillo1986
Copy link

…ing a break. Haven't passed all problems because I'm having trouble with some (such as disemvowel) and fighting the urge to look back at labs

// will access the property values with arr.country
//
function getCountriesSortedByPopulation(arr) {
let newObj = {}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should return an array, not an object.

function getCountriesSortedByPopulation(arr) {
let newObj = {}
for (let element in arr) {
newObj[element] = arr[element]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider what 'element' is, which information you need from the element, and which array method allows you to add data into the array you are going to return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants