Function Definition AST JavaScript Object
The FunctionDefinition
object matches a JavaScript function declaration.
The astType
value for this node is functiondefinition
.
Code Pattern
This object captures the following code block.
def my_function(arg1 = default_value, arg2 = other_value):
...
Attributes
isAsync
(typeboolean
): if this is an async functionname
(typeAstString
): name of the functionreturnType
(typeAstString
): return type of the functionparameters
(typeFunctionDefinitionParameters
): list of parameters for the function