Skip to main content

Home > 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

ParameterTypeDescription
orderedbooleanSort the list if true.

Returns:

this[]

Flattened array of blocks.