Hi All,
I am trying to create a Javascript that will get values from meta-points and compare them to max value. I want the script to be able to iterate the data and display all the values that are greater than the max value not just one.
So far I have only been able to create an if/else-if statements to find the value. The issue with this is it only will display the first occurrence of the value being larger than the max value. I currently have this set up as a Numeric data-type and am setting up an event handler with a max limit detector.
I am unsure if this is possible to loop the values and compare it to the max or create a function which will compare the values? Also if I have to change the data type of the type of event detector I use?
What I have done so far is:
var max = 28;
if (t1.value > max){
return t1.value
}
else if (t2.value > max) {
return t2.value
}
else if (t3.value > max){
return t3.value
}
else if (t4.value > max) {
return t4.value
}
else if (t5.value > max){
return t5.value
}
else if (t6.value > max){
return t6.value
}
else if (t7.value > max) {
return t7.value
}
else if (t8.value > max){
return t8.value
}
Please if anyone has any insight or recommendations on how this could be done it would be greatly appreciated.
Thanks,