Learn Create Your Own Split Screen

Next Page

Naming functions (and parameters) is a lot like naming variables in Scratch.

The name doesn't do anything, and it doesn't mean anything to the computer.

You can call them whatever you like.

Here's the function as we defined it earlier:

function fillCircle (x, y, radius) { ctx.beginPath(); ctx.arc(x, y, radius, 0, Math.PI * 2); ctx.fill(); }
And below you'll see it defined as "banana" instead. Also I've called the radius parameter "size" instead,and I've names x and y "across" and "down" instead.

It still works. The names only have meaning to us; not the computer.


It's usually best to choose names that are sensible and descriptive, because it makes the program much easier for us to understand.