I have an issue when I want to initialize an array. So basically I'm using the library ngx-gauge to display gauges in my application and one of the attributes is thresholds to have three different colors depending of the value. for example:
thresholds = {'0' : {color:'red'}, '100' : {color:'green'}, '200': {color:'orange'}};
My problem is that I want to put instead of '0','100' and '200' a variable. What I tried to do is:
const level1 = manager.getLevelOne();
const level2 = manager.getLevelTwo();
const level3 = manager.getLevelThree();
thresholds ={ level1 : {color:'red'}, level2:{color:'green'}, level3:{color:'orange'}};
However when I console.log thresholds it shows level1,2 and 3 as alias and not their value.