freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../basic-javascript/iterate-with-javascript-do....

985 B

id title challengeType videoUrl localeTitle
5a2efd662fb457916e1fe604 Iterate with JavaScript Do...While Loops 1

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(code.match(/do/g), "You should be using a <code>do...while</code> loop for this.");'
  - text: ''
    testString: 'assert.deepEqual(myArray, [10], "<code>myArray</code> should equal <code>[10]</code>.");'
  - text: ''
    testString: 'assert.deepEqual(i, 11, "<code>i</code> should equal <code>11</code>");'

Challenge Seed

// Setup
var myArray = [];
var i = 10;

// Only change code below this line.

while (i < 5) {
  myArray.push(i);
  i++;
}

After Test

console.info('after the test');

Solution

// solution required