For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let\'s assume the file nam
x = filename.jpg
filename
Though it's pretty late, I will add another approach to get the filename without extension using plain old JS-
path.replace(path.substr(path.lastIndexOf('.')), '')