30 Days Of JavaScript

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

  1. The function keyword

  2. aFunctionName with that funny camel case style.

  3. Adding () after the name is where inputs will go (next lesson)

  4. The code between the { } is the code that is run when we call our function with ...

  5. 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.

Outline

Go Pro?

Upgrade to Pro for quizzes, tracked progress and a completion certificate for just $25 🚀

Want more developer tips, tricks and tools?
Then follow me:
FREE Coding Career Quick Start Guide 🚀
Discover the best way to learn to code, how to land a job and valuable resources to help your journey in this free 15 page value packed guide.
Looking to email me? You can get me on my first name at allthecode.co