We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3d55f4 commit 179adf3Copy full SHA for 179adf3
1-getting-started/2-timers/9-more-challenges-2.js
@@ -0,0 +1,14 @@
1
+const greeting = delay => {
2
+ const newDelay = Math.ceil(delay / 5);
3
+ const intervalDelay = newDelay * 100;
4
+ const intervalId = setInterval(() => {
5
+ console.log(`Hello world. ${intervalDelay}`);
6
+ delay += 1;
7
+ if (delay > (newDelay * 5)) {
8
+ clearInterval(intervalId);
9
+ greeting(delay);
10
+ }
11
+ }, intervalDelay);
12
+}
13
+
14
+greeting(1);
1-getting-started/2-timers/9-more-challenges.txt
@@ -1,4 +1,4 @@
-Challenge 1:
+Challenge 1:
Print "Hello World" forever. Starting with a delay of 1 second
but then incrementing the delay by 1 second each time.
0 commit comments