Update path.js

Maybe I'm missing something, but seems to be a small maybe inconsequent bug. 2nd parameter of slice() is slice end (not included) index