I need a jQuery filter/map/each type function to check if ALL elements satisfy a condition:
function areAllValid(inputs){
return $.someFunction(inputs,
You don't need to use jQuery to do this. You can do this in native JavaScript using Array.prototype.every, which is supported in IE 9+.
function areAllValid(inputs){
return inputs.every(function(input) { return input.length > 0; });
}
If you are using EcmaScript 2015, you can tidy it up further:
var areAllValid = inputs => inputs.every(input => input.length > 0);