AI

Understanding asynchronous callbacks is the first step to mastering Async JS! Let's simulate a food order.

Your Task:

  • Create a function called prepareOrder that takes a callback as an argument
  • Inside prepareOrder, use setTimeout to wait for 100 milliseconds
  • Inside the setTimeout callback, call the passed callback function with the string "Burger Ready!"
  • Call prepareOrder and pass a callback that saves the result to a variable named orderStatus
TypeScript Solution
Loading...

Submit your code to see test results