May 2022
Beginner
304 pages
6h 49m
English
So far in this tutorial, we’ve repeatedly mentioned JavaScript functions, and in this chapter we’ll finally learn how to define functions of our own. The resulting ability gives us greater flexibility as programmers, and enables powerful techniques like forEach (Section 5.4) and functional programming (Chapter 6). Functions: achievement unlocked (Figure 5.1).
Figure 5.1: Time to level up.
As we saw in Section 1.2, function calls in JavaScript consist of a name and zero or more arguments enclosed in parentheses:
> console.log("hello, world!"); hello, world!
As discussed ...
Read now
Unlock full access