1const obj = {
2 name: 'Jean-Luc Picard',
3 rank: 'Captain'
4};
5
6// Prints "name Jean-Luc Picard" followed by "rank Captain"
7Object.keys(obj).forEach(key => {
8 console.log(key, obj[key]);
9});
1Object.keys(object).map(function(objectKey, index) {
2 var value = object[objectKey];
3 console.log(value);
4});
5