code: function validateArrayLengths(len1, len2) {
    var outputLen = len1;
    if (len1 !== len2) {
      if (len1 === 1) {
        outputLen = len2;
      } else if (len2 !== 1) {
        throw new Error('incompatible array lengths: ' + len1 + ' and ' +
          len2);
      }
    }
    return outputLen;
  }
docs: Returns the compatible output vector length for element-wise operation on vectors of length 'len1' and 'len2' or throws an error if incompatible