myObject = {
"key": "value",
"key2":"value2"
}
Object.keys(myObject);
//console.log(Object.keys(myObject)) = ["key", "key2"]
for (let key in object) {
console.log(key);
console.log(object[key]);
}
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.keys(object1)); // expected output: Array ["a", "b", "c"]
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys