blockly > IVariableMap > createVariable

IVariableMap.createVariable() 方法

建立具有指定名稱的新變數。如果未指定 ID,變數對應應建立一個 ID。傳回新變數。

Signature:

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

參數

參數 類型 說明
名稱 字串
id 字串 (選用)
類型 string | null (選用)

退貨:

T