完整 Comparison
填空题 简单
题目
Fill in 空白到 检查如果 `值` 是不 空 and 不 undefined.
代码
const value = "hello";
if (value ___ null && value !== undefined) {
console.log("Has a value");
}
提示
Use strict inequality 到 compare 针对空.
解释
值 !== 空 uses strict inequality 到检查那个 值 是不 空. 组合使用 值 !== undefined, 这个检查那个值 是 neither 空 nor undefined. For "hello", both conditions are true, so 'Has a value' is printed. (You could also use 值 != 空 哪个 covers 两者都空 and undefined 使用 loose equality.)
相关资源
相关课程
- 条件
学习关于 comparison 运算符.
查阅不认识的术语
新手友好的术语表用大白话解释编程术语——变量、函数、DOM、Promise 等等。
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。
动手做项目
通过引导式项目应用所学,含起始代码与解决方案。