Answers for "javascript object get all values by key"

CSS
3

how to get all values from object in javascript

const object1 = {
  a: 'somestring',
  b: 42,
  c: false
};

console.log(Object.values(object1));
// expected output: Array ["somestring", 42, false]

> Array ["somestring", 42, false]

Object.values(obj)
Posted by: Guest on February-20-2021
0

get all keys from pbject javascirpt

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
Posted by: Guest on October-01-2020

Code answers related to "javascript object get all values by key"

Browse Popular Code Answers by Language