1.2 KiB
1.2 KiB
id, challengeType, videoUrl, forumTopicId, localeTitle
id | challengeType | videoUrl | forumTopicId | localeTitle |
---|---|---|---|---|
56533eb9ac21ba0edf2244a9 | 1 | https://scrimba.com/c/cWJ4Bfb | 301171 | 使用赋值运算符初始化变量 |
Description
var myVar = 0;
创建一个名为myVar
的变量并指定一个初始值0
。
Instructions
var
定义一个变量a
并且给它一个初始值9
。
Tests
tests:
- text: 你需要初始化<code>a</code>的值为<code>9</code>。
testString: assert(/var\s+a\s*=\s*9\s*/.test(code));
Challenge Seed
// Example
var ourVar = 19;
// Only change code below this line
After Test
if(typeof a !== 'undefined') {(function(a){return "a = " + a;})(a);} else { (function() {return 'a is undefined';})(); }
Solution
var a = 9;