Checking that a filename does not end with "Com.js" I'm fairly new to JavaScript  and I wonder if there is a way to write this function shorter and better?

   function checkFile(file){       
        var cbEnab= true;
        if (file !== undefined &amp;&amp; file !== null) {
            cbEnab = (!jQuery.endsWith(file, "Com.js"));
        }
        return cbEnab;
    }
By mechanical transformation, I arrive at:

function checkFile(file) {
    return file == null || !jQuery.endsWith(file, "Com.js");
}


The use of === strict equality checking is not necessary; == lumps null and undefined together.

I have my doubts about the whole function, though, as the function name gives no indication that it's going to check whether its argument ends in "Com.js".