Not sure what would perform faster but this would be more reliable when it comes to extension like .jpeg
or .html
x.replace(/\.[^/.]+$/, "")
Not sure what would perform faster but this would be more reliable when it comes to extension like .jpeg
or .html
x.replace(/\.[^/.]+$/, "")