title: How to kill duplicates in array without using Set?
body: <p>How can i delete all duplicates in array without using Set (because it will disturb the order)</p>
  <p>And why my loop with splice method doesnt work?</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>let result = [
    'j', 'a', 'a', 'v',
    'a', 'a', 's', 'c',
    'r', 'i', 'p', 't'
    ]
  ;
  
  
  for (let i = 0; i &lt; result.length; i++) {
          if (result[i] === result[i + 1]){
              result.splice(result.indexOf(result[i]), 1);
          }
  }
  
  console.log(result)  //[  "j", "v", "a",  "a",  "s",  "c", "r", "i",  "p",  "t" ]</code></pre>
  </div>
  </div>
  </p>
  <pre><code>expected output - &gt; [  &quot;j&quot;, &quot;a&quot;,  &quot;v&quot;,  &quot;a&quot;,  &quot;s&quot;,  &quot;c&quot;, &quot;r&quot;, &quot;i&quot;,  &quot;p&quot;,  &quot;t&quot; ]
  </code></pre>