blockly > Workspace > newBlock

Workspace.newBlock() method

Obtain a newly created block.

Signature:

newBlock(prototypeName: string, opt_id?: string): Block;

Parameters

Parameter Type Description
prototypeName string Name of the language object containing type-specific functions for this block.
opt_id string (Optional) Optional ID. Use this ID if provided, otherwise create a new ID.

Returns:

Block

The created block.