title: React Native foreach loop
body: <p>I'm developing a little app in React Native and I am looking for something like a foreach function. I just can't find a foreach loop. Not on StackOverflow and not even in the <a href="https://facebook.github.io/react-native/docs/getting-started.html" rel="noreferrer">docs</a>. I've found something with 'map', but I don't know if this is what I'm looking for.</p>
  <p>With a request to my Server I get multiple objects of users. When I log the result, it looks like this:</p>
  <pre>
  Object {
      "id": "1",
      "role": "user",
      "username": "user1",
    },
  Object {
      "id": "2",
      "role": "admin",
      "username": "user2",
  </pre>
  <p>I'd like to output this to a list.
  In plain PHP I would use a foreach loop for this, but like I said, I can't find a foreach loop for React Native.</p>
  <p>How is it possible to loop trought this objects? I know that I could also use a simple for loop, but this would definitly not be my first choice...</p>
  <p><strong>EDIT:</strong>
  I saved this value in <code>this.state.users</code> with <code>this.setState({users: responseData.users});</code>. State is defined in my constructor. I try to access this with <code>this.state.users.map(id =&gt; &lt;Text&gt;{id}&lt;/Text&gt;)</code> but I always get the same error: <code>null is not an object (evaluating 'this.state.users.map')</code>. Am I doing this right?</p>