title: I want to hide previous if else condition when new condition appears. Is it possible?
body: <p>I want to hide previous marker appears through if else condition when new marker appears.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>                
  if(curTime &gt;= 0 &amp;&amp; curTime &lt;=1){
    L.marker([51.5, -0.08], {icon: greenIcon}).addTo(map);
  } else if(curTime &gt;=2 &amp;&amp; curTime &lt;=3) {
    L.marker([51.5, -0.079], {icon: greenIcon}).addTo(map);
  } else if(curTime &gt;=3 &amp;&amp; curTime &lt;=4) {
    L.marker([51.5, -0.078], {icon: greenIcon}).addTo(map);
  } else if(curTime &gt;=4 &amp;&amp; curTime &lt;=5) {
    L.marker([51.5, -0.077], {icon: greenIcon}).addTo(map);
  } else if(curTime &gt;=5 &amp;&amp; curTime &lt;=6) {
    L.marker([51.5, -0.076], {icon: greenIcon}).addTo(map);
  } else if(curTime &gt;=6 &amp;&amp; curTime &lt;=7) {
    L.marker([51.5, -0.075], {icon: greenIcon}).addTo(map);
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Please help me.</p>