blockly > Variables > nameUsedWithAnyType

Variables.nameUsedWithAnyType() 函式

檢查是否存在具有任何類型的指定名稱的變數。

Signature:

export declare function nameUsedWithAnyType(name: string, workspace: Workspace): VariableModel | null;

參數

參數 類型 說明
名稱 字串 要搜尋的名稱。
工作區 Workspace 要搜尋變數的工作區。

傳回:

VariableModel | 空值

具有指定名稱的變數;如果找不到,則傳回 null 。