1

This code logs out [ { ID: 4 } ].

const result = await db.query(
  `SELECT ID FROM MetaData WHERE MintStatus='unminted' ORDER BY rand() LIMIT 1;`,
);

thisID = JSON.parse(JSON.stringify(result));
console.log(thisID[0]);

But if I do thisID[0].ID it returns undefined. Why?

Sebastian Simon
  • 18,263
  • 7
  • 55
  • 75
Josh
  • 21
  • 2

1 Answers1

-2

If this console.log output is correct.

You can get the ID by writing thisID[0][0].ID

0brine
  • 450
  • 5
  • 18