Web APIs

BroadcastChannel()

Try the free JavaScript compiler

Creates a named channel for eligible contexts within a compatible storage partition.

Formal Syntax & Structure

javascript syntaxjavascript
new BroadcastChannel(name)

Parameters & Attributes

NameTypeDescription
namestringChannel name.

Return Value

BroadcastChannel

Creates a named channel for eligible contexts within a compatible storage partition.

Working Example

Example Snippetjavascript
(async () => {const channel=new BroadcastChannel("v15-lab");try{console.log(channel.name);}finally{channel.close();}})()
JavaScript Reference