STEP 13: We returned the damage information to the spell functions, but we need to return it to a few more!

When functions call other functions, it can be necessary to return values through multiple functions.

  • From , drag Return Statement inside and at the bottom of the fireball() function.
  • Change the variable name from my_var to damage.
  • This will return damage to where we call fire_ball() inside the cast_spell() function!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)