Update ex6

This commit is contained in:
LSvekis
2021-06-28 17:19:55 -04:00
committed by GitHub
parent 5aaab3b7e2
commit a768bb015d
+12 -30
View File
@@ -1,37 +1,19 @@
let start = 10;
function loop(val) {
console.log(val);
if (val < 1) {
return
}
return loop(val - 1);
}
loop(start);
function loop1(val) {
console.log(val);
if (val > 0) {
val--;
loop1(val);
if (val < 1) {
return
}
return 'end';
return loop1(val - 1);
}
loop1(start);
function loop2(val) {
console.log(val);
if (val > 0) {
val--;
loop2(val);
}
return 'end';
}
loop2(start);