title: Create an array of indexes of the most common value of an array in JavaScript
body: <p>How can I create an array of indexes of the most common value of an array (empty strings should be excluded). My array is always of size three, which should simplify the problem but I have yet to find a way to solve this. I'm using JavaScript (ES5), so no access to Set.</p>
  
  <p>E.g. the following would all return an empty array (consider " " as an empty string):</p>
  
  <pre><code>[" ", " ", " "] =&gt; []
  ["a", " ", " "] =&gt; []
  [" ", "b", " "] =&gt; []
  [" ", " ", "c"] =&gt; []
  ["a", "b", " "] =&gt; []
  [" ", "b", "c"] =&gt; []
  ["a", " ", "c"] =&gt; []
  ["a", "b", "c"] =&gt; []
  </code></pre>
  
  <p>and the following would return:</p>
  
  <pre><code>["a", "a", " "] =&gt; [0, 1]
  ["a", "a", "c"] =&gt; [0, 1]
  [" ", "b", "b"] =&gt; [1, 2]
  ["a", "b", "b"] =&gt; [1, 2]
  ["c", " ", "c"] =&gt; [0, 2]
  ["c", "b", "c"] =&gt; [0, 2]
  ["c", "c", "c"] =&gt; [0, 1, 2]
  </code></pre>