Skip to content

Instantly share code, notes, and snippets.

@umidjons
Last active December 20, 2015 17:58
Show Gist options
  • Select an option

  • Save umidjons/6172023 to your computer and use it in GitHub Desktop.

Select an option

Save umidjons/6172023 to your computer and use it in GitHub Desktop.
Get file extension in JavaScript
var file = "some-file.pdf";
var ext = file.split( '.' ).pop();
console.log('File extension is', ext);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment