Skip to content
Advertisement

Printing two values of one variable under different conditions

Please consider the statements below:

sum_value = fixed_value - current_value,

where fixed_value is a constant, and current_value is a function of thresholds;

thresholds has two threshold_level values: thresholds = [10, 20];

I need to find a rato of sim_value corresponding to threshold_level = 10 to sim_value corresponding to threshold_level = 20, that is final_sim_value = sim_value_at_10/sim_value_at_20.

The code part is

JavaScript

which gives this output:

JavaScript

Could you please correct me or suggest a proper solution?

Advertisement

Answer

Are you trying to obtain this result ?

JavaScript

Output

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement