I have the following code:
switch (az) {
case 0:
var azul = "Nivel de Riesgo: [0] Sin Riesgo";
break;
case 1:
var azul = "Nivel de Riesgo: [1] Poco Peligroso";
break;
case 2:
var azul = "Nivel de Riesgo: [2] Peligroso";
break;
case 3:
var azul = "Nivel de Riesgo: [3] Muy Peligroso";
break;
case 4:
var azul = "Nivel de Riesgo: [4] Mortal";
break;
}
switch (ro) {
case 0:
var rojo = "Inflamabilidad: [0] No se Inflama";
break;
case 1:
var rojo = "Inflamabilidad: [1] Inflama a mas de 93°C";
break;
case 2:
var rojo = "Inflamabilidad: [2] Inflama a partir de 93°C";
break;
case 3:
var rojo = "Inflamabilidad: [3] Inflama a parir de 37°C";
break;
case 4:
var rojo = "Inflamabilidad: [4] Inflama a parir de 25°C";
break;
}
the values of az and ro logically go from 0 to 4 but they can take different values example az = 0 ro = 3 and I require that in the blue and red output corresponds to the case of each one, my query is can be joined these 2 or 3 switch since I also have the switch am that gives me the case from 0 to 4 for the yellow variable. Just place 2 of them to see if you can to implement it. Thanks.