跳到主要内容
English

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

讲义

登录或创建账户

IGCSE, A-Level & AP