title: React.js setState() with variable for key inside loop?
body: <p>Is there a way to use a string variable's value as the key for setState()?</p>
  
  <pre><code>getInitialState: function () {
      return {
          foo: '',
          bar: ''
      }
  }
  
  someOtherHandler: function() {
      var arr = ['foo', 'bar'];
      var _this = this;
      var number = Math.random();
  
      for (var i in arr) {
          _this.setState({ arr[i]: number });
      }
  
  }
  </code></pre>
  
  <p>React throws a syntax error with the above, and setting arr[i] to a variable ends up setting a new state with that variable's name.</p>