mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 21:03:58 -05:00
860 B
860 B
id, title, challengeType, videoUrl, forumTopicId
| id | title | challengeType | videoUrl | forumTopicId |
|---|---|---|---|---|
| bd7123c9c441eddfaeb5bdef | 理解布尔值 | 1 | https://scrimba.com/c/c9Me8t4 | 301176 |
--description--
另一种数据类型是布尔(Boolean)。布尔值要么是true要么是false。它非常像电路开关,true是 “开”,false是 “关”。这两种状态是互斥的。
注意
布尔值是不带引号的,"true"和"false"是字符串而不是布尔值,在 JavaScript 中也没有特殊含义。
--instructions--
修改welcomeToBooleans函数,让它返回true而不是false。
--hints--
welcomeToBooleans()函数应该返回一个布尔值 (true/false)。
assert(typeof welcomeToBooleans() === 'boolean');
welcomeToBooleans()应该返回 true。
assert(welcomeToBooleans() === true);