I have a json object that contains an array of objects with similar properties. I'm trying to iterate through the array for each of the objects and display their individual properties. Here's what I have so far...
Object.keys(jsoncont)
.sort(function(a,b) {
return b.localeCompare(a)
})
.forEach(function(key) {
var val = jsoncont[key];
$('#contactSearchResults').html('<div class="resultset"><input type="radio" name="customer_c_id" value="' + val.id + '" /></div><div class="resultset">' + val.first + '</div><div class="resultset">' + val.last + '</div><div class="resultset">' + val.email + '</div>');
});
This is only returning one object in the array. Can someone explain to me how to iterate through all the objects instead of just returning the first result in the key?