1.8 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
bd7123c9c441eddfaeb5bdef Understanding Boolean Values 1 了解布尔值

Description

另一种数据类型是布尔值Booleans可能只是两个值中的一个: truefalse 。它们基本上是很少的开关,其中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 &#40;true/false&#41; 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