Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
blockly > Zablokuj > getDescendants
Metoda Block.getDescendants()
Znajdź wszystkie bryły, które są w nim bezpośrednio lub pośrednio zagnieżdżone. Obejmuje ten blok na liście. Obejmuje dane wejściowe wartości i instrukcji, a także poniższe instrukcje. Nie uwzględnia połączeń na karcie wyników ani poprzednich instrukcji. Bloki można opcjonalnie sortować według pozycji. od góry do dołu.
Podpis:
getDescendants(ordered: boolean): this[];
Parametry
Parametr |
Typ |
Opis |
zamówione |
wartość logiczna |
Jeśli ma wartość prawda, sortuje listę. |
Zwroty:
to[]
Spłaszczona tablica bloków.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[],["The `Block.getDescendants()` method retrieves all blocks nested within a given block, including the block itself. It encompasses blocks connected to value and statement inputs, and subsequent statements, while excluding those on output tabs or preceding statements. The method accepts an optional boolean parameter, `ordered`, to sort the resulting list of blocks by their position (top-to-bottom). It returns a flattened array of the descendant blocks.\n"]]