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) sets w to 3 and h to 5 and returns 15

Handout

Log in or create account

IGCSE, A-Level & AP