val
并设置以下条件的answer
: 1
- “alpha” 2
- “beta” 3
- “伽玛” 4
- “三角洲” caseInSwitch(1)
的值应为“alpha”
testString: 'assert(caseInSwitch(1) === "alpha", "caseInSwitch(1)
should have a value of "alpha"");'
- text: caseInSwitch(2)
的值应为“beta”
testString: 'assert(caseInSwitch(2) === "beta", "caseInSwitch(2)
should have a value of "beta"");'
- text: caseInSwitch(3)
的值应为“gamma”
testString: 'assert(caseInSwitch(3) === "gamma", "caseInSwitch(3)
should have a value of "gamma"");'
- text: caseInSwitch(4)
的值应为“delta”
testString: 'assert(caseInSwitch(4) === "delta", "caseInSwitch(4)
should have a value of "delta"");'
- text: 您不应该使用任何if
或else
语句
testString: 'assert(!/else/g.test(code) || !/if/g.test(code), "You should not use any if
or else
statements");'
- text: 你应该至少有3个break
语句
testString: 'assert(code.match(/break/g).length > 2, "You should have at least 3 break
statements");'
```