Still working on the same issue posted https://codeforum.org/threads/better-than-a-long-list-of-if-statements.5571
However, the solution provided on that thread does not work (I think it's because) it's an old Rhino JS compiler (I was told).
So, nothing fancy on the suggestions. Thank you.
I have a list of about 30 items. I figured out a way to put it into array with a function and using FOR loop to get whether it's "Required" or "Not Required"
Next, if it's Required, I'll need to pass the item number into an IF statement to check whether it's "Submitted" or "Not Submitted".
Questions:
1) Do I need to create 2 array instead of the 1 array? 1st array will hold items on the list; and 2nd array to check if it's Required?
2) Should I change to IF statement to check on Submitted / Not Submitted? Or should I keep it in array?
I welcome suggestion(s) of a more efficient way of doing this.
Thank you.
However, the solution provided on that thread does not work (I think it's because) it's an old Rhino JS compiler (I was told).
So, nothing fancy on the suggestions. Thank you.
I have a list of about 30 items. I figured out a way to put it into array with a function and using FOR loop to get whether it's "Required" or "Not Required"
Code:
var itemReq =[fn(item1), fn(item2),...];
for (let i=0 in arr01)
{
var itemReq = arr01[i];
console.log(itemReq);
}
Next, if it's Required, I'll need to pass the item number into an IF statement to check whether it's "Submitted" or "Not Submitted".
Questions:
1) Do I need to create 2 array instead of the 1 array? 1st array will hold items on the list; and 2nd array to check if it's Required?
2) Should I change to IF statement to check on Submitted / Not Submitted? Or should I keep it in array?
I welcome suggestion(s) of a more efficient way of doing this.
Thank you.