title: Javascript return statement inside filter function, get uniques. Why code works?
body: <p>I have a big array of objects where I need to get the unique values for some keys.
  I have the code working, but I would like to understand it.</p>
  
  <p>Object</p>
  
  <pre><code>{
  "cor": {
      "id": 89,
      "code": "192"
  },
  "tamanho": {
      "id": 74,
      "code": "L"
  },
  "price": "56,34",
  "prevPrice": "93,90",
  "stock": 0
  }
  </code></pre>
  
  <p>And this is the iteration that return only unique values.
  What I can't understand is the return statement, how does javasacript reads it?</p>
  
  <pre><code>var tamanhos = [];
  data.grelha.filter(function(el, i, arr) {
    return tamanhos.indexOf(el.tamanho.id) == -1 &amp;&amp; tamanhos.push(el.tamanho.id);
  });
  </code></pre>
  
  <p>Thanks a lot!</p>