title: Remove duplicates from an array which contains array
body: <p>I have a JSON array like this</p>
  
  <pre><code>[{"Email":"someone@some.com","Name":"ACO","Groups":["MOD_SW","MOD_PI","MOD_GE"],"Id":63,"Url":"aco"},
  {"Email":"someone@some.com","Name":"Agpo","Groups":["MOD_PI"],"Id":22,"Url":"agpo"},
  {"Email":"someone@some.com","Name":"Akatherm","Groups":["MOD_SW"],"Id":64,"Url":"akatherm"},
  {"Email":"someone@some.com","Name":"Albrand","Groups":["MOD_PI,"MOD_GE"],"Id":23,"Url":"albrand"}]
  </code></pre>
  
  <p>I want to create a new array (for select tag) with distinct <code>Groups</code>.</p>
  
  <p>This <code>Groups</code> is an array.</p>
  
  <p>I want that selectbox to have the following values:</p>
  
  <pre><code>MOD_SW
  MOD_PI
  MOD_GE
  </code></pre>
  
  <p>My JS:</p>
  
  <pre><code>UpdateSelectMenu: function (selectId, data) {
        $(selectId).empty();
        $(selectId).html("&lt;option value='all' selected='selected'&gt;All groups&lt;/option&gt;");
        var array_unique_values = [];
  
        for (var i = 0; i &lt; data.Groups.length; i++) {
           for (var j = i+1; j &lt; data.Groups.length; j++) {
              if (data.Groups[i] === data.Groups[j]) {
                 j = ++i;
              }
           }
           array_unique_values.push(data.Groups[i]);
        }
  
        array_unique_values = array_unique_values.sort();
  
        $.each(array_unique_values, function (k, v) {
           $(selectId).append("&lt;option value='" + v + "'&gt;" + v + "&lt;/option&gt;");
        });
     }
  </code></pre>
  
  <p>I tried also </p>
  
  <pre><code>for (var i = 0; i &lt; data.length; i++) {  //browse whole data
           for (var j = 0; j &lt; data[i].Groups.length; j++) {  //browse Groups array
              for (var k = j + 1; j &lt; data[i].Groups.length; k++) {
                 if (data[i].Groups[j] === data[i].Groups[k]) {
                    continue;
                 }
              }
  
              array_unique_values.push(data[i].Groups[j]);
           }
        }
  </code></pre>
  
  <p>But error appears as: <code>Groups.length</code> is null or not an object</p>
  
  <p>This code appends to <code>select</code> tag the Group values but it appears as duplicates because <code>Groups</code> is an array.</p>
  
  <p>I have to create a new <code>for</code> statement to browse the <code>Groups</code> array ?</p>
  
  <p>Or there is another alternative to avoid nested <code>for</code> statements ?</p>
  
  <p>Thank you</p>