title: Multi peer connection in webrtc
body: <p>I use array <code>pc</code> to save RTCPeerConnections from 1 client to other clients then call <code>createOffer</code>. </p>
  
  <p><code>pc</code> is global variable but have an error:  inside createOffer function, I get <code>pc[list[i]]</code> is <code>undefined</code>. How do I fix it?</p>
  
  <pre><code>for (var i = 0; i&lt;list.length - 1; i++) {
      pc[list[i]] = createPC(list[i]);
      pc[list[i]].createOffer(function (localDesc) {
          pc[list[i]].setLocalDescription(localDesc);
          send(localDesc, list[i]);
      }, doNothing, constraints);
  }
  </code></pre>