Functions

Cards (7)

  • Function
    A block of reusable code that can be invoked by calling its name and passing in arguments
  • Invoking a function
    1. Type the function name
    2. Add a set of parentheses
  • Arguments
    Data that is passed into a function when it is invoked
  • Parameters
    Variables defined in the function definition that receive the arguments when the function is called
  • When invoking a function
    The number and order of arguments must match the number and order of parameters
  • Return statement
    A statement used to end a function and send a result back to the caller
  • Functions allow you to write reusable code that can be called with different arguments