The lexical environment of callbacks defined inline as arguments of an invocation

I had a bit of a conceptual hiccup concerning closures and the lexical environment of callback functions which are written in-line as an argument in the invocation of another function.

I wondered if there could be a difference, concerning closures, in some circumstance between a function directly defined in local scope and then passed as an argument by name or in a variable and a function which is defined in-line as an argument right at invocation.

so for example, the following format:

function test(){
    let closureVariable = 'abc';
    let callback = function (){
       console.log(closureVariable);
    }
    setTimeout(callback, 3000);
}

always has the same lexical environment and therefore the same closure, as when the callback is defined in-line like so:

function test(){
    let closureVariable = 'abc';
    setTimeout(function (){console.log(closureVariable)}, 3000);
}

Essentially, there’s no difference between the two, right? Defining a callback function in-line as an argument will never cause it to lose it’s lexical ties to the parent function. Therefore, the callback defined in-line will always have the appropriate closure variables sent along with it, no exceptions?