how to check if a file has an extention in js code example Example: how to check the extension of a file in javascript return filename.split('.').pop();