how do i do a list for bools in javascript. im doing a validation so i can have a list of bools and at the end i want to check that list if it contains any errors. im not sure how to add to the varable validations_errors (like a list). Plus i dont know how i can check if that list contains any true values.
what i got so far is this
var validation_errors;
if (!validateForm($(this))) {
validation_errors = false; //here i want to add the it to a list
var $input_container = $(this).parents('.input');
$input_container.removeClass('success').addClass('error');
}
//this is something what i want to do like (this code is c# based)
if (validation_errors.contains(true)){
// do some actions
}
EDIT
list of bools = list of true & false
If you want to store true or false so you can use indexOf to find which test failed: