Can one reference own properties on initialization of object?
I have an object that should be unique and only exist as one so I have no initializer etc.
Using something like this:
var Myobj = {
property1 : aaa,
property2 : bbb,
property3 : {a: self.property1 }
/* ^-- is this somehow possible without using a function?
Or a better way to solve / structure this. .init()
best option? */
};
>> Fiddle <<
The real object, (in the real code), has an add function that takes options on what function to use etc. It is sort of a wrapper for "addEventListener" where the point is to be able to remove listener - which require non anonymous function reference.
Function to use within Myobj is specified by string, or numeric key in options to
Myobj.add()
.