blockly > IVariableMap > createVariable

IVariableMap.createVariable() method

Creates a new variable with the given name. If ID is not specified, the variable map should create one. Returns the new variable.

Signature:

createVariable(name: string, id?: string, type?: string | null): T;

Parameters

Parameter Type Description
name string
id string (Optional)
type string | null (Optional)

Returns:

T