has_envs
has_envs
功能
判断系统环境中是否存在指定名称。
语法
has_envs(name)
参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| name | String | 否 | '' | 要检查的系统名称。 |
返回值
| 类型 | 说明 |
|---|---|
| Bool | 存在系统函数、库构造函数或系统常量时返回 true。 |
示例
result = has_envs('fs') // 输出:true print result
注意事项
- 可用于检查标准库入口是否存在。
判断系统环境中是否存在指定名称。
has_envs(name)
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| name | String | 否 | '' | 要检查的系统名称。 |
| 类型 | 说明 |
|---|---|
| Bool | 存在系统函数、库构造函数或系统常量时返回 true。 |
result = has_envs('fs') // 输出:true print result