class Singleton instance = null constructor:-> instance ?= @ return instance a = new Singleton b = new Singleton console.log a is b
-
-
@aral you can save 8 characters with "return instance ?= @". Also TIL implicit return is disabled for coffeescript constructors, thank you!Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@aral But then there are the downsides, like the fact that no-one likes coffeescript.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.