Update path.js

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