Check out example codes for "get all keys from pbject javascirpt". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com