And then, stylistically, you could collapse this whole thing into the definition above: `var isFirstOrLast = splitPathLength - 1 === path || splitPathLength === 1;` (or whatever it turns out to be).