0

I am trying to build a json object and I want to specify the key using a variable (testName). When I JSON.stringify the logger object it showing testName instead of the what the variable value actually is. log is a variable and that one shows just fine. It is just the key testName which is not showing the value of the variable. Thanks

logger.push({
  testName: {
    logs: log,
    screenshots: ''
  }
});
jrock2004
  • 3,229
  • 5
  • 40
  • 73

0 Answers0