Chapter 8
Writing and Running Functions
IN THIS CHAPTER
Writing and naming functions
Passing arguments to functions
Returning values from functions
Making anonymous functions
Using arrow functions
Writing functions in objects
Understanding this and context
Linking functions in a chain
“What I do has to be a function of what I can do, not a function of what people ask me to do.”
—TIM BERNERS-LEE
Functions are the objects that make your programs do things. They also serve an important organization purpose: Just as objects organize data into reusable containers, functions organize statements into reusable functionality.
A function is a group of statements that perform a task. In other ...
Get JavaScript All-in-One For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.