Pass Information Around (Function Parameters)

Pass data into and out of functions using arguments and return values.

Functions can do more when you give them information. In this lesson, you’ll learn how to pass arguments and return useful results.

Goal

You’ll aim to:

  • Add parameters to functions.

  • Use return values.

  • Customize behavior based on input.

Function with parameter

So far, we have worked with functions that do not take any inputs. Now, let’s write a function that takes input called parameters and performs some processing with them:

Get hands-on with 1400+ tech skills courses.