title: How to create a list of unique items in JavaScript?
body: <p>In my CouchDB reduce function I need to reduce a list of items to the unique ones.</p>
  
  <p><em>Note: In that case it's ok to have a list, it will be a small number of items of string type.</em></p>
  
  <p>My current way is to set keys of a object, then return the keys of that object
  since the place the code can't use things like <code>_.uniq</code> for example.</p>
  
  <p>I'd like to find a more elegant way to spell it than this.</p>
  
  <pre><code>function(keys, values, rereduce) {
    // values is a Array of Arrays
    values = Array.concat.apply(null, values);
    var uniq = {};
    values.forEach(function(item) { uniq[item] = true; });
    return Object.keys(uniq);
  }
  </code></pre>