js get all values of object

Solutions on MaxInterview for js get all values of object by the best coders in the world

showing results for - "js get all values of object"
Juan Sebastián
04 Jan 2021
1const object1 = {
2  a: 'somestring',
3  b: 42,
4  c: false
5};
6
7console.log(Object.values(object1));
8// expected output: Array ["somestring", 42, false]
9
10> Array ["somestring", 42, false]
11
12Object.values(obj)
Federica
28 Aug 2017
1const object1 = {
2  a: 'somestring',
3  b: 42
4};
5
6for (let [key, value] of Object.entries(object1)) {
7  console.log(`${key}: ${value}`);
8}
9
10// expected output:
11// "a: somestring"
12// "b: 42"
13// order is not guaranteed
Josefina
26 Jul 2019
1Object.values(object1)
similar questions
queries leading to this page
js get all values of object