title: What is enter and exit in d3.js?
body: <p>I tried to understand with this example but couldn't understand exit function. Actually before exit I got what enter is but when I implemented the exit function right after enter function not appended li items created even if I bound different data to the exit function.</p>
  
  <p>Please help me to understand the missions of enter a</p>
  
  <p><a href="https://i.stack.imgur.com/Hxggr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hxggr.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;ul id="#example"&gt;
    &lt;li&gt;&lt;/li&gt;
    &lt;li&gt;&lt;/li&gt;
    &lt;li&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;script&gt;
  
  var updateSelection;
  var veri;
  
  window.onload = function() {
    // Bağlanacak veri sayısı 5
    veri = [5, 10, 15, 20, 25];
  
  
    updateSelection = d3
      .select("ul") 
      .selectAll("li") 
      .data(veri)
      .enter() 
      .append("li")
      .text(d =&gt; d)
      .style("color","blue");
  
    console.log(updateSelection);
  
    updateSelection = d3
      .select("ul") 
      .selectAll("li")
      .data([1,2]) 
      .exit() 
      .append("li")
      .text(d =&gt; d)
      .style("color","red");
  
    console.log(updateSelection);
  
  }
  &lt;/script&gt;
  </code></pre>