var foo = {bar: 'test'};
Object.keys(foo).forEach( function(key) {
// property name
console.log(key);
// property value
console.log(foo[key]);
});
MDN Object.keys
MDN arr.forEach
MDN Enumerability and ownership of properties
var foo = {bar: 'test'};
Object.keys(foo).forEach( function(key) {
// property name
console.log(key);
// property value
console.log(foo[key]);
});
MDN Object.keys
MDN arr.forEach
MDN Enumerability and ownership of properties