Demystifying JavaScript Closures, Callbacks and IIFEs

That statement makes no sense any you appear to have a completely wrong idea about closures - since none of your supposed closure examples actually use a closure.

A closure occurs when a variable or function defined inide of the inner function’s scope continues to be accessible to the outer function even after the inner function has returned. Just about the exact opposite of what you said.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures where tyour examples match the first example that illustrates lexical scope (not closures) The next example on that page illustrates the creation of a closure by returning the function from the inn er scope without executing it and then executing it later after the scope it was created in has closed. There are further example further down that page.

To create a closure you must return something that references elements with inner scope.