title: Extract strings with unique characters from javascript Array
body: <p>I want to extract only those strings which have unique characters, I have an array of strings:</p>
  
  <pre><code>var arr = ["abb", "abc", "abcdb", "aea", "bbb", "ego"];
  Output: ["abc", "ego"]
  </code></pre>
  
  <p>I tried to achieve it using Array.forEach() method:</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>var arr = ["abb", "abc", "abcdb", "aea", "bbb", "ego"];
  const filterUnique = (arr) =&gt; {
    var result = [];
    arr.forEach(element =&gt; {
      for (let i = 0; i &lt;= element.length; i++) {
        var a = element[i];
        if (element.indexOf(a, i + 1) &gt; -1) {
          return false;
        }
      }
      result.push(element);
    });
    return result;
  }
  console.log(filterUnique(arr));</code></pre>
  </div>
  </div>
  </p>
  
  <p>Want to know is any other way to achieve this task ?</p>
  
  <p>Any suggestion.</p>