blockly > Block > getField
Block.getField() method
Returns the named field from a block.
Signature:
getField(name: string): Field | null;
Parameters
Parameter |
Type |
Description |
name |
string |
The name of the field. |
Returns:
Field | null
Named field, or null if field does not exist.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `getField()` method retrieves a specific field from a block using the field's name."],["If a field with the provided name exists, the method returns a `Field` object; otherwise, it returns `null`."],["This method is part of the `Block` class within Blockly and is used to access individual fields on a block for manipulation or inspection."]]],[]]