title: Translating CoffeeScript question mark syntax into Javascript
body: <p>I have a CoffeeScript snippet that uses the Question mark operator. I need to translate into Javascript syntax. The snippet is like the following.</p>
  
  <pre><code>closeItem: (item) -&gt;
      item.close() if item?.close and not item.isClosed
  </code></pre>
  
  <p>I tried to run into CoffeeScript site and the result is the following.</p>
  
  <pre><code>({
    closeItem: function(item) {
      if ((item != null ? item.close : void 0) &amp;&amp; !item.isClosed) {
        return item.close();
      }
    }
  });
  </code></pre>
  
  <p>Is this correct? Based on my knowledge (I'm new both on Javascript and CoffeeScript) I would translate as</p>
  
  <pre><code>closeItem: function(item) {
      if(item &amp;&amp; item.close &amp;&amp; !item.isClosed) item.close();
  }
  </code></pre>
  
  <p>Am I missing something?</p>