Created
September 18, 2018 16:15
-
-
Save sevperez/2e1b318f7bfe28a0cb93fe8be95e88df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function announce(collection) { | |
console.log(collection.description); | |
collection.items.forEach(function(element) { | |
console.log(element); | |
}); | |
} | |
var favoriteCities = { | |
items: { | |
"Denmark": "Copenhagen", | |
"Uganda": "Kampala", | |
"Uraguay": "Montevideo" | |
}, | |
description: "My favorite cities around the world:", | |
}; | |
announce(favoriteCities); | |
// TypeError: collection.items.forEach is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment