1.8 KiB
1.8 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
bd7123c9c441eddfaeb5bdef | Understanding Boolean Values | 1 | 了解布尔值 |
Description
Booleans
可能只是两个值中的一个: true
或false
。它们基本上是很少的开关,其中true
为“on”而false
为“off”。这两个国家是相互排斥的。 注意 Boolean
值永远不会用引号写。 strings
"true"
和"false"
不是Boolean
,在JavaScript中没有特殊含义。 Instructions
welcomeToBooleans
函数,以便在单击运行按钮时返回true
而不是false
。 Tests
tests:
- text: <code>welcomeToBooleans()</code>函数应该返回一个布尔值(true / false)。
testString: 'assert(typeof welcomeToBooleans() === "boolean", "The <code>welcomeToBooleans()</code> function should return a boolean (true/false) value.");'
- text: <code>welcomeToBooleans()</code>应该返回true。
testString: 'assert(welcomeToBooleans() === true, "<code>welcomeToBooleans()</code> should return true.");'
Challenge Seed
function welcomeToBooleans() {
// Only change code below this line.
return false; // Change this line
// Only change code above this line.
}
After Test
console.info('after the test');
Solution
// solution required