Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.35 KB

File metadata and controls

31 lines (21 loc) · 1.35 KB

Hints

General

  • Callback functions are functions passed as an argument to a calling function.
  • Callback functions must meet the specification of the calling function.

1. Notify with a successful message

  • Use the imported API function notify in your function.
  • Pass an object to notify. It should have a property of message. Think about what the message value should be.
  • Pay attention to the JSDoc type hint -- the function should not return a value.

2. Notify with an error message

  • Use the imported API function notify in your function.
  • Pass another object to notify. It should have a property of message. The message value should differ from the last part.
  • Pay attention to the comments [JSDoc] above the function definition:
    • The function should not return a value.

3. Place an order to buy fruit

  • Use the already imported order function.
  • Pay attention to the JSDoc type hints -- the function should receive 3 arguments and not return a value.
  • Reuse the previously created callbacks as arguments to the order function.

4. Refactor your work into a more concise function

  • Reuse the functions from the previous tasks.
  • Pay attention to the JSDoc type hints -- the function should receive 2 arguments and not return a value.
  • Combine the arguments into an object representing the query to the grocer to place an order.