jessicamarcus
5/24/2015 - 11:38 PM

print all key/vals of an object to the console

print all key/vals of an object to the console

var obj = object;

for (key in obj) {
    console.log('val [' + key + ']\n\n ' + obj[key] + '\n\n');
}


// if we only wanted the names of each key:
console.log(Object.keys(obj));