From the course: Learning the JavaScript Language
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Callback functions and looping - JavaScript Tutorial
From the course: Learning the JavaScript Language
Callback functions and looping
- [Instructor] In this video we're going to talk about callback functions. We've seen these in use a couple of times but I want to give them a little specific attention because they're used a lot in modern JavaScript. Callback function is a piece of jargon, meaning a function that's passed as an argument, into another function and executed in that function. Because functions are first class citizens in JavaScript, you'll see this all over the place. Here's a function called doubleIt which takes a number and returns it multiplied by two using the multiplication assignment operator. And then here's a variable called myNumbers with the digits one through five in it. A start up node down here. And let's bring these in. Copy and paste so we have them available. JavaScript arrays have a method called map that takes a callback for the parameter. That callback has one required parameter itself, the item in the array that we're…
Contents
-
-
-
-
-
-
-
-
(Locked)
Basic functions4m 20s
-
(Locked)
Arguments and parameters in functions6m 54s
-
(Locked)
More on function arguments5m 3s
-
(Locked)
Objects, references, and functions7m 4s
-
(Locked)
Functions are objects5m 8s
-
(Locked)
Jargon: Scope in JavaScript2m 30s
-
(Locked)
Functions and scope5m 11s
-
(Locked)
Writing shorter functions with arrows3m 12s
-
(Locked)
Three little dots collect the rest4m 14s
-
(Locked)
Callback functions and looping4m 34s
-
(Locked)
-
-