while
" bucle porque funciona "mientras que" una condición especificada es verdadera y se detiene una vez que la condición ya no es cierto.
var ourArray = [];Intentemos que funcione un bucle while empujando los valores a una matriz.
var i = 0;
while(i < 5) {
ourArray.push(i);
i++;
}
myArray
usando un while
de bucle.
while
de bucle para esto.
testString: 'assert(code.match(/while/g), "You should be using a while
loop for this.");'
- text: ' myArray
debe ser igual a [0,1,2,3,4]
.'
testString: 'assert.deepEqual(myArray, [0,1,2,3,4], "myArray
should equal [0,1,2,3,4]
.");'
```