September 2017
Beginner
666 pages
11h 35m
English
A function is a chunk of code that can be referenced by a name, and is almost like a small, self-contained mini program. Functions can help reduce repetition and make code easier to follow.
In this chapter, we’ll be covering these topics:
Defining functions―function declarations, function expressions, Function() constructors and the new arrow syntax
Invoking a function
Return values
Parameters and arguments
Hoisting―variables and functions
Callbacks―functions as a parameter
Project ― we’ll be using functions to make the Quiz Ninja code easier to follow
In JavaScript, functions are considered to be first-class objects. This means they behave in the same way as all the other primitive data types and objects in the ...
Read now
Unlock full access