When I move away from JavaScript, I forget these after a while and always have to refresh my memory.
// Enumerate the keys in an object.
function enumKeys(obj) {
Object.keys(obj).forEach(function(key) {
console.log(obj[key]);
});
}
// Enumerate the keys in an object. | |
function enumKeys(obj) { | |
Object.keys(obj).forEach(function(key) { | |
console.log(obj[key]); | |
}); | |
} |