Joined May 2011
·

Louis Acresti

NY, USA
·
·
·

@pyros2097 -- nope, that will not work. In the constructor, the value of @addWidget is undefined, because no method called addWidget is specified on the Widget prototype; it is specified on the Widget object itself; a "static" method.

@micapam: Look closely: notice the @ in front of the name of addWidget? That means the function is actually a static member of the Widget class. More importantly, this in the context of a static method's body actually refers to the class itself!

An interesting note: In the context of an object's member function, @constructor would actually be identical to Widget based on how CoffeeScript implements classes. Try it!

Posted to The single most useful thing in bash over 1 year ago

This is better than [CTRL]+[R].

I believe he was referring to this:

// The extra two characters are the alpha channel:
background-color: #EEEEEE00;
// Or...
background-color: #eee0;
Achievements
404 Karma
95,023 Total ProTip Views