>won't this remove the last character if it isn't + ?

Hmm, now when you mentioned it I start to concern myself. With that code I assumed that `pop` is an `Array` only function and it is not available for strings. I.e. the first `name.pop` is just `isArray?` and the second `name.pop` removes the last array item which is always `"+"` or `""` if the name is an array.
But now I see how confusing it may look so let me know if you'd prefer me to update this part with more straightforward code (using `Array.isArray` or so).