What can you simplify for explanation in
(function(){ console.log(this) })();
Your expression (in the first set of brackets) defines the function. Then you call this function without context ( this). This design is called IIFE . Since you are not going through the context, the behavior depends on whether it is called in strict mode or not:
undefined, , . , "use strict"; .
, , ,
(function(){ console.log(this) }).call(someobject);