title: RTCPeerConnection.createOffer "promise" usage
body: <p>I am learning WebRTC recently and found a usage of "promise" here (<a href="https://github.com/mdn/samples-server/blob/master/s/webrtc-simple-datachannel/main.js" rel="noreferrer">https://github.com/mdn/samples-server/blob/master/s/webrtc-simple-datachannel/main.js</a>). </p>
  
  <pre><code>localConnection.createOffer()
      .then(offer =&gt; localConnection.setLocalDescription(offer))
      .then(() =&gt; remoteConnection.setRemoteDescription(localConnection.localDescription))
      .then(() =&gt; remoteConnection.createAnswer())
      .then(answer =&gt; remoteConnection.setLocalDescription(answer))
      .then(() =&gt; localConnection.setRemoteDescription(remoteConnection.localDescription))
      .catch(handleCreateDescriptionError);
  </code></pre>
  
  <p>localConnection and removeConnection are RTCPeerConnection objects. 
  From here <a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection</a>, </p>
  
  <blockquote>
    <p>createOffer:</p>
    
    <p>void createOffer(RTCSessionDescriptionCallback successCallback,
    RTCPeerConnectionErrorCallback failureCallback, optional
    MediaConstraints constraints);</p>
  </blockquote>
  
  <p>createOffer has 3 parameters. But why the above code does not have the parameters? where are the parameters?</p>