diff --git a/documentation/coffee/constructor_destructuring.coffee b/documentation/coffee/constructor_destructuring.coffee index 53c4b39a..4274282c 100644 --- a/documentation/coffee/constructor_destructuring.coffee +++ b/documentation/coffee/constructor_destructuring.coffee @@ -2,3 +2,5 @@ class Person constructor: (options) -> {@name, @age, @height} = options +tim = new Person age: 4 + diff --git a/documentation/index.html.erb b/documentation/index.html.erb index 8e09a98c..aedbf376 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -805,7 +805,7 @@ Expressions Destructuring assignment is also useful when combined with class constructors to assign properties to your instance from an options object passed to the constructor.
- <%= code_for('constructor_destructuring', 'contents.join("")') %> + <%= code_for('constructor_destructuring', 'tim.age') %>diff --git a/documentation/js/constructor_destructuring.js b/documentation/js/constructor_destructuring.js index 13b81030..41a8a1ba 100644 --- a/documentation/js/constructor_destructuring.js +++ b/documentation/js/constructor_destructuring.js @@ -1,5 +1,5 @@ // Generated by CoffeeScript 1.6.3 -var Person; +var Person, tim; Person = (function() { function Person(options) { @@ -9,3 +9,7 @@ Person = (function() { return Person; })(); + +tim = new Person({ + age: 4 +});