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.4 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
cf1111c1c11feddfaeb1bdef Iterate with JavaScript While Loops 1 在循环时使用JavaScript进行迭代

Description

您可以使用循环多次运行相同的代码。我们将学习的第一种类型的循环称为“ while ”循环因为它在“while”运行时指定的条件为true并且一旦该条件不再为真就停止。
var ourArray = [];
var i = 0;
i <5{
ourArray.push;
我++;
}
让我们尝试通过将值推送到数组来实现while循环。

Instructions

使用while循环将数字0到4推送到myArray

Tests

tests:
  - text: 你应该使用<code>while</code>循环。
    testString: assert(code.match(/while/g));
  - text: '<code>myArray</code>应该等于<code>[0,1,2,3,4]</code> 。'
    testString: assert.deepEqual(myArray, [5,4,3,2,1,0]);

Challenge Seed

// Setup
var myArray = [];

// Only change code below this line.

After Test

console.info('after the test');

Solution

// solution required