I'm having trouble with JS loops. In fact i'm new to JS and I would like my script to iterate through 2 params which can take 2 values and then iterate another time through test values.
I came out with some code but it is pretty ugly and not optimized at all. I would like to know how to improve this code in a way that I can be able tu use variables easly in the inner loop.
Thanks a lot for your help !
const param_value_array = ['param1', 'param2']
const values = [true, false]
const test_value_array = ['0', '1', '0toto', '1toto']
values.forEach(param1_status => {
values.forEach(param2_status => {
test_value_array.forEach(test_value => {
console.log('param1' + ' ' + param1_status + ' & '+ 'param2' + ' ' + param2_status + ' > ' + test_value)
})
})
})