I often see this pattern:
var suchAndSuch = new (function() {
this.thing = "something";
this.whoaLookAtThat = function() {
return 4;
}
return {
'thing' : thing,
'whoaLookAtThat' : whoaLookAtThat
}
})();
What is going on here? It's the return
statement part that confuses the hell out of me.
I just don't get this particular use of an IIFE.
If nothing else, knowing what it's called would help me research it.