title: Javascript Logical Operator && used to Assign Properties
body: <p>I encountered this piece of code:</p>
  
  <pre><code>var value = this.newTodo &amp;&amp; this.newTodo.trim();
  </code></pre>
  
  <p>In this example: <a href="http://codepen.io/anon/pen/rONEMQ?editors=101" rel="nofollow">http://codepen.io/anon/pen/rONEMQ?editors=101</a></p>
  
  <p>I don't understand what the <strong>AND</strong> (<strong><em>&amp;&amp;</em></strong>) operator is trying to accomplish.</p>
  
  <p>In my understanding the <strong>&amp;&amp;</strong> Operator is to asign multiple properties to a value, but this doesn't seem to be the case here.</p>
  
  <p>I my code example, I don't see any difference, for when I use this:</p>
  
  <pre><code>var value = this.newTodo &amp;&amp; this.newTodo.trim();
  </code></pre>
  
  <p>Instead of this:</p>
  
  <pre><code>var value = this.newTodo;
  </code></pre>
  
  <p>Or just this: </p>
  
  <pre><code>var value = this.newTodo.trim();
  </code></pre>
  
  <p>Can anyone explain, what the initial line stated above and in the example does with the <strong>&amp;&amp;</strong>?</p>