O'Reilly logo

JavaScript for Sound Artists by Steve Leonard, William Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5  Functions

In this chapter, you will learn about functions, various ways to work with functions, and variable scope. Functions allow you to write code in a way that avoids repetition. They also allow you to encapsulate your code and perform a specific task based on a set of inputs. Scope pertains to the context in which variables are declared. JavaScript handles variables differently depending on their scope, and you will learn how to use variables in functions when writing programs.

Images  Functions—A Simple Example

To explain functions, let’s look at the design of an audio effects module. Imagine a simple hardware audio effects box equipped with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required