title: JS: And if every function return "this" as a default value?
body: <p>I have a code design question. Consider the following code:</p>
  
  <pre><code>thatObj.doThis().setThat().add().update();
  </code></pre>
  
  <p>To allow chaining, I'm often writing <code>return this;</code>, and sometimes, here or there I forget to do it, then I got an error.</p>
  
  <p>In many cases, I'm not asking for a particular result (e.g. <code>thatObj.getName()</code> or <code>thatObj.getChildren()</code>), but instead wanting to do some updates or calling setters (e.g. <code>thatObj.setName("foo")</code> or <code>thatObj.addChild(child)</code> or <code>thatObj.update()</code>), I was wondering if it would be more convenient to <code>return this;</code> for any call of methods, I mean as a javascript default behaviour, and if not, what could be the reasons not to do so.</p>