* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
1.5 KiB
1.5 KiB
id, title, challengeType, forumTopicId, dashedName
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
a77dbc43c33f39daa4429b4f | 基本类型布尔值的检查 | 5 | 16000 | boo-who |
--description--
检查一个值是否是基本类型中的布尔值(boolean)类型。函数应返回 true 或者 false。
基本类型中的布尔值为 true 或者 false。
--hints--
booWho(true)
应返回 true。
assert.strictEqual(booWho(true), true);
booWho(false)
应返回 true。
assert.strictEqual(booWho(false), true);
booWho([1, 2, 3])
应返回 false。
assert.strictEqual(booWho([1, 2, 3]), false);
booWho([].slice)
应返回 false。
assert.strictEqual(booWho([].slice), false);
booWho({ "a": 1 })
应返回 false。
assert.strictEqual(booWho({ a: 1 }), false);
booWho(1)
应返回 false。
assert.strictEqual(booWho(1), false);
booWho(NaN)
应返回 false。
assert.strictEqual(booWho(NaN), false);
booWho("a")
应返回 false。
assert.strictEqual(booWho('a'), false);
booWho("true")
应返回 false。
assert.strictEqual(booWho('true'), false);
booWho("false")
应返回 false。
assert.strictEqual(booWho('false'), false);
--seed--
--seed-contents--
function booWho(bool) {
return bool;
}
booWho(null);
--solutions--
function booWho(bool) {
return typeof bool === "boolean";
}
booWho(null);