Saurabh Tajanekatanasword.hashnode.dev·Sep 16, 2024Hoisting and Temporal Dead ZoneJavaScript Hoisting JavaScript goes through the code file collects references and stores those references in memory and executes code line-by-line. The memory preparation phase is a hoisting, Take functions and store their reference, take let and con...51 readsJavaScript
Gaurav Goswamigauravgoswami.hashnode.dev·Jul 22, 2024HoistingWhen you're starting with JavaScript you'll surely bump into something known as hoisting. If you're a beginner, this could be a little tricky as well as confusing because this hoisting thing lets you access a variable even before declaring it and som...33 readsJavaScript
Yugam Gangaryugamgangar.hashnode.dev·Jul 8, 2024Hoisting & Temporal Dead Zone in JavaScriptWe all might have heard of "hoisting" while working in JavaScript. But not everyone knows in depth about it. In this post let's dive deep into it. var colour = "white"; console.log(colour); // white Here it's a simple block of code where the vari...tzd
Shakir Bakareshakirbakare.hashnode.dev·Jun 24, 2024Understanding Hoisting and the Temporal Dead Zone in JavaScriptI'm sure you've encountered the error message Cannot access 'x' before initialization or seen undefined when running JavaScript code. These issues arise due to hoisting and the Temporal Dead Zone (TDZ). Understanding these concepts is crucial for wri...Mastering Javascript
Bhavesh Jadhavbhaveshjadhav.hashnode.dev·May 27, 2024JavaScript Essentials: Understanding Scope, Lexical Environment, and HoistingUnveiling JavaScript Scope, Lexical Environment, and Hoisting: Demystifying Key Concepts Scope: Where Variables and Functions Live Scope determines where you can access a specific variable or function in your code. It is directly dependent on the lex...10 likesJavascript BasicsJavaScript
Abhishek Dandriyalabhishek-dandriyal.hashnode.dev·Apr 8, 2024Javascript Scope: Var, Let and ConstVariable shadowing: In JavaScript, variable shadowing occurs when a variable with the same name as a variable in a higher scope is declared in a lower scope, potentially causing confusion; let a = 10; if (true) { let a = 20; console.log(a); } ...1 likeIllegal shadowing
Gaurav Goswamigauravgoswami.hashnode.dev·Mar 31, 2024How JavaScript works??? 🤔💭When I started my journey with JavaScript I used to think about how things work under the hood, why the setTimeout code runs after the synchronous code, how is it even possible to call a function even before declaring it, and why do we get errors if ...1 like·157 readsjsworking
Amit Gossaiamitbhu.hashnode.dev·Jan 7, 2024what do you mean by Hoisting and Temporal Dead Zone in JS ?Hoisting is a concept that enables us to extract values of variables and functions even before initializing/assigning value without getting errors and this happens during the 1st phase (memory creation phase) of the Execution Context. In the context ...JavaScript
Corina Murgcorina.hashnode.dev·Oct 2, 2023The Temporal Dead ZoneThe Temporal Dead Zone sounds like a sci-fi movie, doesn't it? But in the JavaScript universe, it's the space where a variable is off-limits, even though you might think it should be available. This behavior occurs with variables declared using let a...1 likeHoisting in JavaScriptJavaScript
Ekaterine (Catherine)ekaterine-mitagvaria.hashnode.dev·Sep 28, 2023What is the Temporal Dead Zone in JavaScript?The temporal dead zone is one of the most essential things to understand when you first start learning JavaScript as it will make it much easier to continue your JavaScript journey. In this article, we are going to understand what a temporal dead zon...30 readsJavaScript