1.3 KiB
1.3 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
bd7123c9c441eddfaeb5bdef | 理解布爾值 | 1 | https://scrimba.com/c/c9Me8t4 | 301176 | understanding-boolean-values |
--description--
另一種數據類型是布爾(Boolean)。 布爾值只能是兩個值中的一個:true
或者 false
。 它非常像電路開關,true
是 “開”,false
是 “關”。 這兩種狀態是互斥的。
注意: 布爾值是不帶引號的。 字符串 "true"
和 "false"
不是布爾值,在 JavaScript 中也沒有特殊含義。
--instructions--
修改 welcomeToBooleans
函數,當 run 按鈕點擊時讓它返回 true
而不是 false
。
--hints--
welcomeToBooleans()
函數應該返回一個布爾值 (true
或者 false
)。
assert(typeof welcomeToBooleans() === 'boolean');
welcomeToBooleans()
應該返回 true
。
assert(welcomeToBooleans() === true);
--seed--
--after-user-code--
welcomeToBooleans();
--seed-contents--
function welcomeToBooleans() {
// Only change code below this line
return false; // Change this line
// Only change code above this line
}
--solutions--
function welcomeToBooleans() {
return true; // Change this line
}