From 6d06eaa5c0c228f51f1217642fd3adf4fc0e88de Mon Sep 17 00:00:00 2001 From: Clarence Date: Tue, 22 Apr 2025 17:01:42 +0100 Subject: [PATCH] fix(curriculum): resolve hoisting transcript errors (#59885) --- .../67335f45489c5a11b71d0ed5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/25-front-end-development/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md b/curriculum/challenges/english/25-front-end-development/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md index a26348c978a..443942c281d 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-the-var-keyword-and-hoisting/67335f45489c5a11b71d0ed5.md @@ -35,7 +35,7 @@ x = 5; console.log(x); // 5 ``` -Function hoisting works a bit differently. When you declare a function using the `function` declaration syntax both the function name and the function body are hoisted. This means you can a function before you've declared it in your code. Here's an example of function hoisting: +Function hoisting works a bit differently. When you declare a function using the `function` declaration syntax both the function name and the function body are hoisted. This means you can call a function before you've declared it in your code. Here's an example of function hoisting: ```js sayHello(); // "Hello, World!" @@ -56,7 +56,7 @@ let y = 10; These declarations are hoisted but they are not initialized and you can't access them before the actual declaration in your code. This is often referred to as the temporal dead zone. -Understanding hoisting can help you write cleaner, more predictable code. However, relying on hosting can make your code harder to read and maintain. As a best practice, it's recommended to declare your variables at the top of their scope and your functions before you use them regardless of hoisting. This make your code's behavior more explicit and easier for other including your future self to understand. +Understanding hoisting can help you write cleaner, more predictable code. However, relying on hoisting can make your code harder to read and maintain. As a best practice, it's recommended to declare your variables at the top of their scope and your functions before you use them regardless of hoisting. This make your code's behavior more explicit and easier for other including your future self to understand. # --questions--