I meant:
> var errorType = (type === ValueType.DISPLAY_VALUE) ? 'displayError' : 'error';

So later you can do:
> error = this.properties[i][errorType];

and
> nestedError = this.properties[i].displayValue.properties[j][errorType];

without the extra conditions.