How to Get the File Extension from a Filename String
You can combine lastIndexOf() and slice() to get the file extension.
You can combine lastIndexOf() and slice() to get the file extension.
Use the negative indexing of the slice method to remove the last character from a string.