Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Latest commit

 

History

History
39 lines (25 loc) · 1.4 KB

functions.md

File metadata and controls

39 lines (25 loc) · 1.4 KB

Functions

The Concept

By "functions" we mean functions, methods and procedures.

We do not aim to teach:

  • "functions" as the concept of self-contained pieces of functionality
  • the concepts of passing data into functions
  • the concept of returning data from functions

Language-specific rules such as closures, anonymous functions, or partial application, should be covered in tracks.

What to cover

  • How to define a function How to define a function. How to add functionality to a function?
  • How to use function parameters How to define function parameters and how to use them.
  • How to return a value from a function How to return a value from a function. Does it require a specific keyword?
  • How to invoke a function How to invoke a function and pass arguments to it.

Exercises

Lasagna cooking

This exercise deals with cooking a lasagna dish in the oven. The reference implementation (JavaScript) teaches:

  • How to define a function with zero, one and two parameters.
  • How to use parameters in a function.
  • How to return a value from a function.
  • How to call a function.

Implementations

Track Exercise Changes
JavaScript basics None