Determine file extensions using JavaScript
    
    •
    1 min read
  
  
    
      Heads up! This post was written in 2008, so it may contain information that is no longer accurate. I keep posts like this around for historical purposes and to prevent link rot, so please keep this in mind as you're reading.
— Cory
A quick JavaScript function to determine a file's extension.
function fileExt(path) {
  return path.substr(path.lastIndexOf('.') + 1);
}
  
  
    Hi there! I just open sourced my creative outlet including more than 80 web components. I'm calling it Quiet UI.
    Visit quietui.org to check it out!
— Cory