From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
What are function expressions in JavaScript?
From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
What are function expressions in JavaScript?
Okay, so we've covered declarative functions. Now, we've looked at writing a function, adding an input with number to create the area of a square. We looked at changing objects with functions, which is very powerful. The next thing I want to discuss is this isn't the only way to write functions. We're writing functions here as statements. But you can also write functions as expressions. So what we're going to do is we're going to create a new file. And let's call this function-expressions.js and we can create that file and by the way in the terminal now I'm going to type in clear and when I do that it should clear out all of that clear up all of this top stuff here so we have a nice fresh slate. All right I'll push the terminal down for now and we're going to learn, I'll bring in my comments here, learn about function expressions. So So we can start off by saying a function expression can be anonymous and does not need to have a name. So how would we write that? How do you write a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Download Node.js and what is Node.js?2m 23s
-
(Locked)
Setting up our learning environment5m 42s
-
(Locked)
What are functions in JavaScript?9m 42s
-
(Locked)
Example of how functions work in JavaScript for complete beginners9m 18s
-
(Locked)
What are function expressions in JavaScript?9m 28s
-
(Locked)
JavaScript interview question trick with function expressions and utility fun16m 14s
-
(Locked)
What is function hoisting in JavaScript?6m 37s
-
(Locked)
How scope works in JavaScript15m 53s
-
(Locked)
What are closures and an example with JavaScript explained?11m 49s
-
(Locked)
Advanced closure module pattern with data privacy encapsulation15m 16s
-
(Locked)
What are arrow functions and usefulness in React?17m 13s
-
(Locked)
Destructuring with JavaScript23m 1s
-
(Locked)
-
-
-
-
-
-
-
-