I am very new to javascript (and programming in general, for that matter), and I am having difficulty reworking this bit of code:
Once I create the array...
...how do I loop through and check to see if each object in the array (not just one) is valid? For instance:
I suspect the answer to this question is somewhat rudimentary, but I was unable to find it anywhere else in the forum. Perhaps I am not using the correct terms in my search? In any case, any guidance would be much appreciated.
Thanks,
Matthew
Code:
if ((a1 == 'valid') && (a2 == 'valid') && (a3 == 'valid') && (a4 == 'valid')) { // do something }
Code:
var theArray = [a1, a2, a3, a4]
Code:
if (theArray[all] == 'valid') { // do something }
Thanks,
Matthew
Comment