title: What difference does that make to use find vs includes?
body: <p>I am trying to create a method called addTrack with the following functionality:</p>
  
  <ul>
  <li>Accepts a track argument</li>
  <li>Use the track’s id property to check if the
  current song is in the playlistTracks state</li>
  <li><p>If the id is new, add the song to the end of the playlist.</p></li>
  <li><p>Set the new state of the playlist.</p></li>
  </ul>
  
  <p>What would be the difference if I use the code #1 instead of code #2? </p>
  
  <p>PlaylistTracks is defined in the constructor as following: </p>
  
  <pre><code>playlistTracks: [{ name: 'name1', artist: 'artist1', album: 'album1', id: 1 },
          { name: 'name2', artist: 'artist2', album: 'album2', id: 2 },
        ]
  </code></pre>
  
  <p><strong>Code #1</strong></p>
  
  <pre><code>addTrack(track){
  if (this.state.playlistTracks.includes(this.props.track.id)) {return;}
  else {this.state.playlistTracks.push(track);
    this.setState({playlistTracks:this.state.playlistTracks});
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Code #2</strong></p>
  
  <pre><code>addTrack(track) {
  if (this.state.playlistTracks.find(savedTrack =&gt; savedTrack.id===track.id) {return;}
  else {return this.state.playlistTracks.push(track);}
  this.setState(playlistTracks:this.state.playlistTracks)}
  </code></pre>