Confused. I am trying to create an object that should initialize itself. Alas, there are gaps in my knowledge.
var obj = { // params, functions... init : (function(){ alert(obj); })() }
Alas, undefined is displayed, i.e. The object has not yet been created, but the function has already been called. How to solve this problem? It is possible so:
... init : function(){ alert(obj);} }
And cause artificially:
obj.init()
However, I would like to automate the process ...