This practice set covers essential JavaScript concepts, including setTimeout
, setInterval
, and basic arithmetic operations. Each question is designed to test your understanding of asynchronous operations and mathematical computations in JavaScript.
-
Delayed Message Display
- Write a function that displays "Hello, World!" after a delay of 3 seconds.
-
Time Logger
- Create a function that logs the current time to the console every 2 seconds, stopping after 10 seconds.
-
Delayed Sum Calculation
- Write a function that takes two numbers as arguments and logs their sum after a 2-second delay.
-
Countdown Timer
- Implement a countdown timer that starts from 5 and counts down to 0, displaying each number with a 1-second interval. When it reaches 0, print "Time's up!" after an additional 1-second delay.
-
Delayed Multiplication
- Write a function that takes two numbers and returns their product after a 1-second delay.