Created
May 4, 2014 22:33
-
-
Save fer-ri/d2c3d65dfb51e7e3f345 to your computer and use it in GitHub Desktop.
Get File Extension In Javascript / NodeJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getExtension(string) { | |
| return string.substr((~-string.lastIndexOf(".") >>> 0) + 2); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment