0

There is an object which always has a different name.

Example: {0.8337090382971908: "DELETED"}

how can i get his name and status?

ceri
  • 5
  • 3

1 Answers1

0

You can use Object.keys() and Object.values() respectively along with Array Destructuring:

const obj = {0.8337090382971908: "DELETED"};

const [ name ] = Object.keys(obj);
const [ status ] = Object.values(obj);

console.log(name);
console.log(status);
Mohammad Usman
  • 34,173
  • 19
  • 88
  • 85