mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Add example of destructuring assignment in class constructors for options
This commit is contained in:
parent
1731f7d321
commit
7fdd21b26d
4 changed files with 52 additions and 0 deletions
12
documentation/js/constructor_destructuring.js
Normal file
12
documentation/js/constructor_destructuring.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Generated by CoffeeScript 1.3.3
|
||||
var Person;
|
||||
|
||||
Person = (function() {
|
||||
|
||||
function Person(options) {
|
||||
this.name = options.name, this.age = options.age, this.height = options.height;
|
||||
}
|
||||
|
||||
return Person;
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue