4 ms·
Or if ECMAscript 5 is an option checkout object.defineProperty allows specification of getter, setter, and writable flag (among others).
by grannyg00se 15y ago
Or if ECMAscript 5 is an option checkout
object.defineProperty
allows specification of getter, setter, and writable flag (among others).
- ronaldj 15y agoThe syntax is ugly. They should've made it a little less verbose.
- Cushman 15y agoI'm sure CoffeeScript will adopt a much more elegant syntax for the feature :)
- epidemian 15y agoThat might be a quite distant future. See: "Unsupported features" at https://github.com/jashkenas/coffee-script/wiki/FAQ https://github.com/jashkenas/coffee-script/wiki/FAQ https://github.com/jashkenas/coffee-script/issues/451 https://github.com/jashkenas/coffee-script/issues/451 https://github.com/jashkenas/coffee-script/issues/64 https://github.com/jashkenas/coffee-script/issues/64 https://github.com/jashkenas/coffee-script/issues/322 https://github.com/jashkenas/coffee-script/issues/322