So, here is the POJO:
var foodwebsites = {
"bacon": [{
"url": "stackoverflow.com",
}],
"icecream": [{
"url": "example.com",
}],
"cheese": [{
"url": "example.com",
}]
}
What I would like to do is to have an if statement doing something like:
if (there is at least one nested object with a "url") {
$('body').append("<div>" + url +"</div>");
}
So that the end result should be:
(HTML)
<body>
<div>stackoverflow.com</div>
<div>example.com</div>
</body>
If you don't understand my question, please tell me and I'll try an explain it better.
For answers that worked, I said "this works" or "it worked" somewhere in the comments so people viewing this question can find it easy to find their answer.