Exercise 1.3: Callbacks

Level 1

Exercise 1: Function process with a number and a callback. It should call the callback with the number.

Exercise 2: Function calculator with two numbers and a callback. It should perform an operation (sum) using the callback.

Level 2

Exercise 3: Function waitAndGreet that waits 2 seconds before calling the callback with the name.

Exercise 4: Function processElements that receives an array and a callback, and applies the callback to each element.

Level 3

Exercise 5: Function processString that converts a string to uppercase and passes the result to a callback.

⚠️ Important: Open the browser console (F12 or Ctrl+Shift+I) to see the results of the exercises and verify that they work correctly.

Back to index