title: How to create a function that acts the same way as the method includes()
body: <p>I am trying to create a function that would work the same way as the method includes by using two parameters. Right now it only works with methods that would return false, however, true doesn't work and I can't figure out why it doesn't go into the if statement.</p>
  <pre><code>function includes(array, value) {
      for(let i =0; i &lt; array.length; i += 1) {
          if (array[i] === value) {
              return true;
          } else {
              return false;
          }
      }
  }
  
  includes([1,2,3,4,5], 3);
  </code></pre>