How can I get the value of another object from the same JSON while declaring?
var constant = {
    roles: {
      ADMIN: 'admin',
      CONSUMER: 'consumer',
      SUPER_ADMIN: "super_admin"
    },
    webAccess : [roles.ADMIN]
}
console.log(constant);
Expected output:
{
  "roles": {
    "ADMIN": "admin",
    "CONSUMER": "consumer",
    "SUPER_ADMIN": "super_admin"
  },
  "webAccess": [
    "admin"
  ]
}
 
     
    