title: Check for a value in JSON returned in a REST endpoint
body: <p>Im kinda new to React-native (and javascript) and I'm struggling to do this.</p>
  
  <p>I have an api that has a users</p>
  
  <p><a href="https://api.example.com/users/" rel="nofollow noreferrer">https://api.example.com/users/</a></p>
  
  <p>And I want it to check if the api returns a value when I hit an endpoint</p>
  
  <p><a href="https://api.example.com/users/" rel="nofollow noreferrer">https://api.example.com/users/</a>{userName}</p>
  
  <p>So something like this :</p>
  
  <pre><code>async function getUsersFromApi(userName) {
        try {
           let response = await 
           fetch('https://api.example.com/users/'+userName);
           let responseJson = await response.json();
  
           //if endpoint returns response
           // alert("endpoint exists")
  
         } catch(error) {
              console.error(error);
         }
        }
  </code></pre>
  
  <p>The part I wrote in comments was the part I was struggling with. Any help would be greatly appreciated.</p>