title: Uncaught (in promise) TypeError:
body: <p>I am trying to add numbers from 0-99 to myData function so it prints all of my users with one click. But I'm getting an error.</p>
  
  <blockquote>
    <p>Error: <em>index.js:14 Uncaught (in promise) TypeError: Cannot read property 'userId' of undefined
        at index.js:14</em></p>
  </blockquote>
  
  <pre><code>function number() {
      for (let i = 0; i &lt; 100; i++) {
          i;
      }
  }
  
  const myData = () =&gt;  {
      fetch('https://jsonplaceholder.typicode.com/posts?fbclid=IwAR2aHkMfSVPYV3va38MKu-jOahl9G8UzyPJ1Dd67EyskMPZMw1gN9xi-AUg')
      .then(response =&gt; {
          return response.json();
      })
      .then(users =&gt; {
          document.getElementById('demo').innerHTML += `
          User ID: ${users[number()].userId}&lt;Br&gt; 
          ID: ${users[number()].id}&lt;br&gt; 
          Title: ${users[number()].title}&lt;Br&gt;
          Desc: ${users[number()].body}`;
      })
  }
  
  </code></pre>