In his example, he almost made a closure. You should read about it. If it had any variable in the context of a self-named function, you would have a closure.
Also note that in your teacher example, something has a function on its prototype. In your example, you deleted the prototype Something, replacing it with an empty one.
Renan source share