Skip to main content

Home > 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, type?: string, id?: string | null): T;

Parameters

ParameterTypeDescription
namestring
typestring(Optional)
idstring | null(Optional)

Returns:

T