Get directory of a file name in Javascript

I don’t know if there is any built in functionality for this, but it’s pretty straight forward to get the path.

path = path.substring(0,path.lastIndexOf("\\")+1);

Leave a Comment