MessageChannel
The MessageChannel
interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties.
Properties
Link copied to clipboard
The port1
read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
Link copied to clipboard
The port2
read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.