function fileExt(file) {
    "use strict";
    try {
        return file.split('.').pop().toLowerCase().trim();
    } catch(e) {
        return '';
    }
}
Returns the file extension in lower case.

@param  String  file  File path
@return string