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 is function hoisting in JavaScript?
From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment
What is function hoisting in JavaScript?
Let's make a new file. So we have a new lesson. Let's learn about function hoisting. I know the last lesson was pretty intense. So this is going to be a little bit more fun and chill, but it's going to continue to solidify our fundamentals for functions. So we're going to call it function hoisting. We'll save it wherever you can access it with your terminal. Let's clear the terminal up. Oops. Open up my terminal and clear it from our last lesson. And let's learn about function hoisting. So function hoisting is interesting to learn because it also helps to solidify how JavaScript works as well. So we can say that JavaScript essentially interprets, or we can say the JavaScript interpreter, because remember, we write JavaScript, and then the engines then compile it down. So the JavaScript interpreter that's interpreting our JavaScript hoists our function declarations to the top of the current scope. We'll talk more about scope in the next lesson to get deeper with scope. When we just…
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)
-
-
-
-
-
-
-
-