blockly > 变量 > nameUsedWithAnyType

Variables.nameUsedWithAnyType() 函数

检查是否存在具有任意类型的给定名称的变量。

Signature:

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

参数

参数 类型 说明
name string 要搜索的名称。
工作区 Google Workspace 要在其中搜索变量的工作区。

返回

VariableModel | null

具有指定名称的变量,如果未找到,则返回 null。