This One Line Confuses 99% of JavaScript Developers! 😵💫 #javascript
This one-liner in JavaScript confuses most developers!
We define an arrow function and assign values like:
let a = b = 3
It looks like both a and b are block-scoped, but here’s the catch:
JavaScript treats this as:
let a = (b = 3)
That makes b a global variable!
So when we log b outside the function, it still prints 3 — no error.
Always declare all variables using let, const, or var to avoid bugs like this.
#javascript #webdev #interviewprep #learnjavascript #codingtricks #frontenddev #shorts
Видео This One Line Confuses 99% of JavaScript Developers! 😵💫 #javascript канала Sathelli Srikanth
We define an arrow function and assign values like:
let a = b = 3
It looks like both a and b are block-scoped, but here’s the catch:
JavaScript treats this as:
let a = (b = 3)
That makes b a global variable!
So when we log b outside the function, it still prints 3 — no error.
Always declare all variables using let, const, or var to avoid bugs like this.
#javascript #webdev #interviewprep #learnjavascript #codingtricks #frontenddev #shorts
Видео This One Line Confuses 99% of JavaScript Developers! 😵💫 #javascript канала Sathelli Srikanth
Комментарии отсутствуют
Информация о видео
1 июня 2025 г. 19:30:25
00:00:58
Другие видео канала