title: Variable assignment in conditional statement to test if property undefined in object
body: <p>I wonder if it's a good idea to assign a variable inside a conditional statement.</p>
  
  <p>For instance:</p>
  
  <pre><code>var sum = {}
  
  var objs = [{"a": 1, "b":2, "c":3}, {"a": 2, "b": 3, "c":4}, {"a": 3, "b":4, "c":5}];
  
  objs.forEach(function(obj) {
     Object.keys(obj).forEach(function(key) {
         ((sum[key] += obj[key]) || (sum[key] = obj[key]))
     });
  });
  </code></pre>
  
  <p>or is it better to do something like:</p>
  
  <pre><code>objs.forEach(function(obj) {
     Object.keys(obj).forEach(function(key) {
         sum[key] = typeof sum[key] != "undefined" ? sum[key] + obj[key] : obj[key];
     });
  });
  </code></pre>