We could use ternary operator(?:) instead:
```javascript
var resp = response,
     math_code = (resp.error)
                          ? "\text{" + resp.error + "}"
                          : resp.preview;
```