title: Passing a value to the constructor of a CoffeeScript class
body: <p>I'm trying to pass a value to the constructor of a CoffeeScript Class without success:</p>
  
  <pre><code>class A
  
    constructor: () -&gt;
  
      @b = new B('FOO')
  </code></pre>
  
  <p><br></p>
  
  <pre><code>class B
  
    constructor: (@value) -&gt;
  
    printValue: () =&gt;
      console.log @value
  </code></pre>
  
  <p><br>
  When I call printValue from an instance of B then 'undefined' is logged in the console. Why is 'FOO' not being logged?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I should have mentioned Class A instance is created in a third class C, like so:</p>
  
  <pre><code>class C
  
    constructor: () -&gt;
  
      @a = new A()
  </code></pre>
  
  <p><br></p>
  
  <p>All three classes are in different files and joined together in this order C ontop of A on top of C.</p>