Skip to content

Instantly share code, notes, and snippets.

@amarema
Last active August 13, 2019 13:26
Show Gist options
  • Save amarema/0b7a56d9837f9c71be32a2e51ca5e143 to your computer and use it in GitHub Desktop.
Save amarema/0b7a56d9837f9c71be32a2e51ca5e143 to your computer and use it in GitHub Desktop.
Get file extension
const getExtension = str => str.substring(str.lastIndexOf('.') + 1);
const str = getExtension('some.class.jsx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment