I'm currently facing some issues with my code, as it's not working properly. I have three variables that set the state of another set of three variables. Instead of writing out the code three times, I wanted to use another variable (like 'i') to determine which one is active. However, I keep encountering errors. I've tried searching for a solution but couldn't find any examples.
Code:
var position1 = "a";
var position2 = "a";
var position3 = "a";
var input1 = 250;
var input2 = 0;
var input3 = 0;
var i = 1;
while (z <= 3) {
if (input(i) <= minvalue + range){
position(i) = "a";
}
// Other if conditions go here...
document.getElementById("slider" + i).style.top = position(i);
z = z + 1;
}