title: Couple all keys that have the same values:
body: <p>I have a key-value array that stores nodes and all their connections. The array looks something like:</p>
  
  <pre><code>A =&gt; {C}
  B =&gt; {D}
  C =&gt; {A,F,G,H,J}
  D =&gt; {B}
  E =&gt; {F,G,H}
  F =&gt; {C,E}
  G =&gt; {C,E}
  H =&gt; {C,E}
  I =&gt; {-}
  J =&gt; {C}
  K =&gt; {-}
  </code></pre>
  
  <p>I would like to couple all the keys that have the same values. In this case F,G and H have the same values, as well as A and J. I would like to put them in an array something like arr = [{F,G,H},{A,J}];</p>
  
  <p>How can that be done in javascript?</p>