Day 5: Functions Part 1
Lesson 2: No Input, No Return
We are going to have a series of short lessons today, slowly building up a function from something very simple to something quite complicated.
The simplest form of a function takes no inputs and returns nothing. Here is such a function:
We declare the function with
The
function
keywordaFunctionName
with that funny camel case style.Adding
()
after the name is where inputs will go (next lesson)The code between the
{ }
is the code that is run when we call our function with ...aFunctionName()
to "call it" (or in technical terms: invoke it)
Try changing the name of the function, try calling it more than once by copying where we call it.