Check out this link:
https://jsfiddle.net/3fmp43db/
data = [{
city: 'Mushroom Kingdom',
}, {
city: 'Mushroom Kingdom',
}, {
city: 'Mushroom Kingdom',
}, {
city: 'Mushroom Kingdom',
}, {
city: 'Mushroom Kingdom',
}, {
city: 'Mushroom Kingdom',
}, {
city: 'Planet Zebes',
}, {
city: 'Planet Zebes',
}, {
city: 'Planet Zebes',
}];
for(var i = 0; i < data.length; i++) {
var obj = data[i];
$(".test").append(obj.city + "<br>")
}
This task seems simple, but I'm struggling to find a way to eliminate duplicate values before displaying the list.