Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 576 Bytes

isUndefined.md

File metadata and controls

25 lines (16 loc) · 576 Bytes
标题 标签
isUndefined(是否是未初始化值) type(类型)

检查指定的值是否未定义。

  • 使用严格相等运算符检查 val 是否等于 undefined。
const isUndefined = val => val === undefined;

调用方式:

isUndefined(undefined); // true

应用场景

结果如下:

<iframe src="codes/javascript/html/isUndefined.html"></iframe>