Skip to content

Instantly share code, notes, and snippets.

@vkartk
Created March 7, 2022 12:15
Show Gist options
  • Save vkartk/bbefdb98618079f434dc4e31f790d685 to your computer and use it in GitHub Desktop.
Save vkartk/bbefdb98618079f434dc4e31f790d685 to your computer and use it in GitHub Desktop.
JavaScript get the file extension
// JavaScript get the file extension
function getExtension(filename){
const ext = filename.split('.').pop();
return ext;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment