I cannot understand why
1) 'https://api.rest.com/v1/users/' + userId + '/resource/'
and
2) resourceId ? resourceId : ''
both evaluate correctly.
But, when I try to evaluate on one line:
'https://api.rest.com/v1/users/' + userId + '/resource/' + resourceId ? resourceId : ''
it results in just the evaluation of the second original expression (2).
What is the reason for this?