blockly > Block > getSurroundParent

Block.getSurroundParent() method

Return the parent block that surrounds the current block, or null if this block has no surrounding block. A parent block might just be the previous statement, whereas the surrounding block is an if statement, while loop, etc.

Signature:

getSurroundParent(): this | null;

Returns:

this | null

The block (if any) that surrounds the current block.