Introduction

Completed

When we think about writing code, we always want to ensure that our code is readable. Although this statement sounds counterintuitive, code is read many more times than it's written.

One core tool in a developer's toolbox to ensure maintainable code is the function. At its core, a function is a block of code you can run on demand. This code might perform a task, such as going to a different part of a website, or calculate a value, such as the sum of two numbers.

In this module, you'll learn:

  • How to write a basic function.
  • What parameters are and how to use them.
  • How to return values from a function.
  • How to use anonymous functions.