title: coffeescript scope of variable assignment vs property assignment in object's other properties
body: <p>I'm writing some widgets for <a href="https://github.com/felixhageloh/uebersicht" rel="nofollow">Ubersicht</a>. It uses a node.js server and treats each <code>.coffee</code> file as a standalone widget object. I'm having issues defining constant settings to be used throughout one file. Currently I know of two ways to define this type of constant at the top of the file.</p>
  
  <pre><code># Way 1
  foo_1 = true
  bar_1 = false
  # Way 2
  foo_2: true
  bar_2: false
  </code></pre>
  
  <p>Further down in the same file either a property is assigned as a string or as a function. Each of the above two ways of defining an option only works in one of the two property types.</p>
  
  <pre><code>staticProperty: """Output #{foo_1} works here
  but output of #{foo_2} doesn't work
  """
  
  methodProperty: (input) -&gt; 
    if foo_1 # Raises foo_1 is not defined
    if @foo_1 # foo_1 is undefined which is expected
    if @foo_2 # This works fine
  </code></pre>
  
  <p>I understand that way 2 add to the object's properties, but I'm not too sure how the way 1 assignment works given that the file is essentially defining an object. Can you explain this?</p>
  
  <p>Also is there a way to define a variable that can be accessed from both places?</p>