Validator function in Backbone
I would approach that like this:

Have an array with all the fields you

var mandatoryFields = ['firstAttr','secondAttr'];


Then have a validate function that takes attrs, mandatoryFields and errors

function validate( o , mandatoryFields, errors )
{
  for( var i = 0 , i &lt; mandatoryFields.length ; i++ )
  {
    var field = mandatoryFields[i];
    if(!o[field]) 
      errors.push(field + " mandatory");
  }
}


Note that I replaced attrs with fields but fare more readable, I also added a new-line  after that if statement for readability.