Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

defined(…)

作用

条件表达式函数,判断变量是否已定义。

语法

if defined(${HOME}) {
  gx.echo(value: "has home");
}

if !defined(${NO_SUCH_VAR}) {
  gx.echo(value: "missing");
}

说明:

  • 这是表达式函数,不是 gx.defined 命令。