Skip to content

Functions

  • A function is a named block of code you can run again and again.
  • function name(params) { ... return value; }. The params are the inputs.
  • return hands a value back to whoever called the function.

area(3, 5) passes w = 3 and h = 5 into function area, which returns 15

Handout

Log in or create account

IGCSE, A-Level & AP