blockly > Block > getDescendants

Block.getDescendants() method

Find all the blocks that are directly or indirectly nested inside this one. Includes this block in the list. Includes value and statement inputs, as well as any following statements. Excludes any connection on an output tab or any preceding statements. Blocks are optionally sorted by position; top to bottom.

Signature:

getDescendants(ordered: boolean): this[];

Parameters

Parameter Type Description
ordered boolean Sort the list if true.

Returns:

this[]

Flattened array of blocks.