What is “truthy” and “falsy” in JavaScript? Why is "0" truthy?
What is “truthy” and “falsy” in JavaScript? Why is "0" truthy?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: hard
标签: interviewbit, javascript, topic-specific, frontend
参考答案摘要
Truthy values act like true in conditions. Falsy values act like false. JavaScript has only a few falsy values. "0" is truthy because it is a non-empty string. Only empty strings are falsy. Falsy valu...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。