title: Get state value by a dynamic key in react
body: <p>Let's say in my component I set the state like so:</p>
  
  <pre><code>this.setState({
        test: "value",
        othertest: "value"        
  });
  </code></pre>
  
  <p>If, elsewhere in my code, I have an array containing the keys for these values, ie- <code>keys = ["test", "othertest"]</code> how can I loop through this array to find the value of the corresponding state value?</p>