Skip to content

Commit

Permalink
unit test #1
Browse files Browse the repository at this point in the history
  • Loading branch information
iAlgebra committed Nov 24, 2019
1 parent fd513cd commit 5d9ee87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tareas/clase-4/algoritmo-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ Resultado: 10 9 8 7 6 5 4 3 2 1

function printFromOneToTen() {
let num = 10;
let list = [];
while (num > 0) {
console.log(num);
list.push(num);
num--;
}
return list;
}

printFromOneToTen();
console.assert(JSON.stringify(printFromOneToTen()) ===
JSON.stringify([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]),
'Debe mostrar un array conteniendo los numeros del 10 al 1');

0 comments on commit 5d9ee87

Please sign in to comment.