Block.getParent() method
Return the parent block or null if this block is at the top level. The parent block is either the block connected to the previous connection (for a statement block) or the block connected to the output connection (for a value block).
Signature:
getParent(): this | null;
Returns:
this | null
The block (if any) that holds the current block.