Archive for May 31st, 2012

31May

Getters and Setters in Coffee on NodeJS

Posted by Elf Sternberg as Uncategorized

I can’t claim ownership of this, only the refinement of using Coffee’s native prototype specifier.  But it’s a sweet, sweet way of creating a getter/setter pair in a coffeescript class: Function::define = (prop, desc) ->     Object.defineProperty this::, prop, desc class CheckThisOut     _fld1: null     constructor: (@_fld1 = {}) ->   […]


Subscribe to Feed

Categories

Calendar

May 2012
M T W T F S S
« Apr   Jun »
 123456
78910111213
14151617181920
21222324252627
28293031