What is this "reduce" and "showHelpMessageIfInvalid" do, any other reference help to understand it?
// Show error messages if required fields are blank
var allValid = component.find('contactField').reduce(function (validFields, inputCmp) {
inputCmp.showHelpMessageIfInvalid();
return validFields && inputCmp.get('v.validity').valid;
}, true);
2 answers