title: Returning objects in JavaScript in different ways, one works the other doesn't
body: <p>Below code works</p>
  
  <pre class="lang-js prettyprint-override"><code>return {
    getinput:function(){
      return{
        type:document.querySelector(domStrings.inputType).value,
        description:document.querySelector(domStrings.inputDescription).value,
        value:document.querySelector(domStrings.inputValue).value
      };
    }
  }
  </code></pre>
  
  <p>and below code doesn't</p>
  
  <pre class="lang-js prettyprint-override"><code>var klop={
    type:document.querySelector(domStrings.inputType).value,
    description:document.querySelector(domStrings.inputDescription).value,
    value:document.querySelector(domStrings.inputValue).value
  };
  
  return {
    getinput:function(){
      return klop;
    }
  }
  </code></pre>