blockly > VariableMap > renameVariableById

VariableMap.renameVariableById() method

Rename a variable by updating its name in the variable map. Identify the variable to rename with the given ID.

Signature:

renameVariableById(id: string, newName: string): void;

Parameters

Parameter Type Description
id string ID of the variable to rename.
newName string New variable name.

Returns:

void