Javascript IIFE as an object's property (method)
问题 I'm trying to use an IIFE as a method (which might be wrong). Why ? Because, I'm trying to implement the proxy design pattern. In adobe extendscript, there is an "app" object to access documents, etc, like - var length = app.activeDocument.length; // or some other property Now, I wanted to put a proxy around "app". So I created a proxy object - var AppProxy = { activeDocument: function() { // do stuff...; return app.ActiveDocument; } } But now, this is how I had to access it - var length =