* 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>
849 B
849 B
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
56533eb9ac21ba0edf2244a9 | 使用赋值运算符初始化变量 | 1 | https://scrimba.com/c/cWJ4Bfb | 301171 | initializing-variables-with-the-assignment-operator |
--description--
通常在声明变量的时候会给变量初始化一个初始值。
var myVar = 0;
创建一个名为myVar
的变量并指定一个初始值0
。
--instructions--
通过关键字var
定义一个变量a
并且给它一个初始值9
。
--hints--
你需要初始化a
的值为9
。
assert(/var\s+a\s*=\s*9\s*/.test(code));
--seed--
--after-user-code--
if(typeof a !== 'undefined') {(function(a){return "a = " + a;})(a);} else { (function() {return 'a is undefined';})(); }
--seed-contents--
--solutions--
var a = 9;