Get a file with any extion js code example
Example 1: javascript find file extension from string
var ext = fileName.split('.').pop();
Example 2: how to get file extension in javascript
var fileName = "myDocument.pdf";
var fileExtension = fileName.split('.').pop(); //"pdf"