object.keys value code example
Example 1: Return the Objects Keys and Values
const keysAndValues = (obj) => [Object.keys(obj), Object.values(obj)];
keysAndValues({a: 1, b: 2, c: 3});
keysAndValues({a: "Dell", b: "Microsoft", c: "Google"}));
keysAndValues({key1: true, key2: false, key3: undefined});
Example 2: object keys javascript
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.keys(object1));
Example 3: object.keys javascript
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.keys(object1));