Temporal Dead Zone Breaks Code!

JavaScript's Temporal Dead Zone will crash your code! Accessing let/const before declaration throws an error. Watch the chaos!

#javascript #javascripttricks #codingtips #programmingtutorial #temporaldeadzone #javascriptquiz #codingchallenge #javascriptshorts #javascriptbugs #hoisting #javascriptwtf #letconst

#Summer #Lifting #Hoisting #photography #CraneWork #hauling

Okay folks, just sit back and enjoy your summerday.

I'll do the heavy lifting.

Wednesday carTOONS - Democratic Underground Forums

New post: https://codito.in/frontend-refactoring-notes/

We talk about some lessons for a beginner developer like dependencies, hoisting, shipping source or bundle, using linters to guide a clean architecture and so on.

#frontend #npm #hoisting #dependencies #architecture #eslint #cleancode #software #refactoring

Inside Out | Notes on refactoring a frontend app

Packaging, dependencies and architectural sanity.

I've always preferred `function`-style over lambda style (`() => {}`) for named functions in #JavaScript because I think it's less confusing for newcomers and you can take advantage of #hoisting which can be a useful feature.

However, thinking about it again, hoisting can also lead to a lot of confusion as it leads to temporal dead zone which can be super confusing, even to experienced developers.

```
doSomething();
let value = 1;
function doSomething(): void {
// ERR: Cannot access 'value' before initialization
console.log(value);
}
```

Based on that, I wonder if lambda style might actually be less confusing for new JS devs just because it avoids that entire class of footgun.

In practice I find this kind of issue to be relatively rare, but maybe new devs encounter it more frequently than I think.

I guess the question here is: Is JS function hoisting a useful feature or an antipattern to avoid?

「巻き上げ」の誤解【JS】 - Qiita

はじめに悪名高きvarですが、その理由の一つに「巻き上げ(Hoisting)」があると言われています。https://analogic.jp/hoisting/その「巻き上げ」について誤解して…

Qiita
Hoists are, generally speaking, one of the safest 🛡️ pieces of #liftingequipment as they come with safety features incorporated into their design.
#lifting #hoisting #hoistingequipment #hoist #industry #industrial
#warehouse
https://lifestyleblogau.wordpress.com/2024/01/31/hoisting-101-different-types-of-equipment-explained/
Hoisting 101: Different Types of Equipment Explained

Every single type of lifting equipment is characterised by its weight bearing capabilities and the same can be said for hoisting equipment. Hoists are, generally speaking, one of the safest pieces …

Lifestyle blog
Demystifying JavaScript Scoping and Hoisting

Welcome to this insightful journey into the heart of JavaScript's scoping and hoisting mechanisms. As...

DEV Community

Wiedzieliście, że JavaScript potrafi być całkiem inteligentny ("taaa, jasne...") i wiedzieć o zmiennych lub funkcjach, których jeszcze nie zadeklarowaliśmy? Nazywa się to hoisting i może nie jest aż tak użyteczne jak inne mechanizmy, ale warto o tym wiedzieć.

#JavaScript #programowanie #hoisting

https://www.freecodecamp.org/news/what-is-hoisting-in-javascript-3

What is Hoisting in JavaScript | Hoisting Functions, Variables and Classes

Hoisting is a concept or behavior in JavaScript where the declaration of a function, variable, or class goes to the top of the scope they were defined in. What does this mean? Hoisting is a concept you may find in some programming languages (such as JavaScript) and not in others.

freeCodeCamp.org