Encountering an issue with initializing an array while using the ngx-gauge library to display gauges in my application. One of the attributes is thresholds, which determines three different colors based on the value. For example:
thresholds = {'0' : {color:'red'}, '100' : {color:'green'}, '200': {color:'orange'}};
The problem arises when attempting to replace '0', '100', and '200' with variables. This was my attempted solution:
const level1 = manager.getLevelOne();
const level2 = manager.getLevelTwo();
const level3 = manager.getLevelThree();
thresholds ={ level1 : {color:'red'}, level2:{color:'green'}, level3:{color:'orange'}};
However, when printing out thresholds with console.log, it displays level1, 2, and 3 as aliases rather than their actual values.