Object.keys(data).forEach(function (key, index) {
var value = data[key];
console.log(key,index, value);
});
var showKeys = function(obj){
var keys = [];
for(var key in obj){
keys.push(key.toString() + "
");
}
console.log("{
" + keys + "}");
}
const user = {
name: 'Alex',
age: 30
};
const props = Object.keys(user);
console.log(props); // [ 'name', 'age' ]
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.keys(object1));
// expected output: Array ["a", "b", "c"]
const obj = {name: "John", age: 30}
console.log(obj)