We don't lose the `fileId` variable? But if it's too much, what about:

    var fileId = trailerDict.get('ID');
    fileId = (fileId && fileId.length) ? fileId[0] : '';

The if else, and two variable names seem a bit too verbose - but if you like it better the other way, do what you please.