Can you just do

```
var appender = url.length > 0 && url[url.length - 1] == '?' : '&' : '?';
``