I have an array composed by nine elements:
var ar = ['a','a','a','a','a','a','a','a','a'];
I need to control three elements at a time by a function that returns a true or false. If the first returns true, the others do not have to execute in order to obtain just one true result.
var one = fun(ar.slice(0, 3));
if (one != false) document.write(one);
var two = fun(ar.slice(3, 6));
if (two != false) document.write(two);
var three = fun(ar.slice(6, 9));
if (three != false) document.write(three);
How can I simplify this process? To avoid the creation of a multiarray.
Thanks !!