object .values code example
Example 1: object values javascript
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.values(object1));
Example 2: object values
const object1 = {
a: 'somestring',
b: 42,
c: false
};
console.log(Object.values(object1));
Example 3: get all entries in object as array hjs
const object1 = {
a: 'somestring',
b: 42
};
for (let [key, value] of Object.entries(object1)) {
console.log(`${key}: ${value}`);
}
Example 4: Object.Values () javascript
const object1 = {
a:"somestring",
b: 42,
c: false,
d: function test()
};
console.log(Object.values(object1));
const object2 = "test";
console.log(Object.values(object2));