find a file that has a certain name with any extention js code example
Example 1: javascript find file extension from string
var ext = fileName.split('.').pop();
Example 2: how to get the extension from filename using javascript
var ext = fileName.substr(fileName.lastIndexOf('.') + 1);