Skip to content

Instantly share code, notes, and snippets.

@amslezak
Last active January 24, 2020 22:15
Show Gist options
  • Save amslezak/dbecd23215a6be215e71edb19337f341 to your computer and use it in GitHub Desktop.
Save amslezak/dbecd23215a6be215e71edb19337f341 to your computer and use it in GitHub Desktop.
basic key/value object loop pattern
json.forEach(function(val){
var keys = Object.keys(val);
console.log(keys)
html += "<div class='cat'>"
keys.forEach(function(key) {
html += "<strong>" + key + "</strong>: " +val[key]+ "<br>";
});
html += "</div><br>"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment