Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

1.8 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
56533eb9ac21ba0edf2244aa Understanding Uninitialized Variables 1 了解未初始化的变量

Description

声明JavaScript变量时它们的初始值为undefined 。如果对undefined变量进行数学运算,则结果将为NaN ,表示“非数字” 。如果将字符串与undefined变量连接起来,您将得到一个"undefined"的文字字符串

Instructions

初始化三个变量a bc5 10 ,和"I am a"分别让他们不会undefined

Tests

tests:
  - text: <code>a</code>应定义并评估其值为<code>6</code>
    testString: assert(typeof a === 'number' && a === 6);
  - text: 应定义和评估<code>b</code>的值为<code>15</code>
    testString: assert(typeof b === 'number' && b === 15);
  - text: <code>c</code>不应该包含<code>undefined</code>并且值应为“我是一个字符串!”
    testString: assert(!/undefined/.test(c) && c === "I am a String!");
  - text: 不要更改行下方的代码
    testString: assert(/a = a \+ 1;/.test(code) && /b = b \+ 5;/.test(code) && /c = c \+ " String!";/.test(code));

Challenge Seed

// Initialize these three variables
var a;
var b;
var c;

// Do not change code below this line

a = a + 1;
b = b + 5;
c = c + " String!";

After Test

console.info('after the test');

Solution

// solution required