Promise.resolve UNWRAPS Thenables?!

Promise.resolve has RECURSIVE unwrapping! Any object with a 'then' method gets called. Nested thenables unwrap ALL the way down until a real value appears. This automatic unwrapping will confuse your async code!

#javascript #javascripttricks #promise.resolve #thenables #asyncunwrapping #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #promisequirks #advancedjavascript

https://www.youtube.com/watch?v=7gDt_tC_Jw8

Promise.resolve UNWRAPS Thenables?! #JavaScript

YouTube

Math.min() > Math.max() Returns TRUE?!

⚠️ YOUR BRAIN WILL EXPLODE! Math.min() is GREATER than Math.max()! This breaks EVERY rule of mathematics! The answer will shock you. 97% of developers get this wrong!

#javascript #javascripttricks #codingchallenge #math.min #math.max #javascriptquiz #javascriptweird #javascriptwtf #mindblown #javascriptbugs #codingtips #javascriptshorts

https://www.youtube.com/watch?v=au8mR2rlVgo

Math.min Math.max Returns TRUE?! #javascriptweird

YouTube

Arrow Functions Have NO arguments?!

Arrow functions BREAK arguments! They don't have the arguments object. This will cause ReferenceError when you try to use it. Regular functions work, arrows don't!

#javascript #javascripttricks #arrowfunctions #argumentsobject #thisbinding #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #functiondifferences #advancedjavascript

https://www.youtube.com/watch?v=rckkbJzGLeE

Arrow Functions Have NO arguments?! #javascripttricks

YouTube

Reflect API Shows HIDDEN Properties?!

Reflect.ownKeys REVEALS secrets! It shows non-enumerable properties that Object.keys hides. This is how you see ALL properties, even hidden ones!

#javascript #javascripttricks #reflectapi #propertyenumeration #hiddenproperties #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #reflection #advancedjavascript

https://www.youtube.com/watch?v=6dsBorCXo_0

Reflect API Shows HIDDEN Properties?! #ReflectAPI

YouTube

void Operator Returns WHAT?!

🤯 MIND BLOWN! The void operator ALWAYS returns undefined, no matter what! void(1+2+3) = undefined! This ancient JavaScript feature is still used in modern code. 95% of devs don't know this exists!

#javascript #javascripttricks #codingchallenge #voidoperator #javascriptoperators #javascriptquiz #javascriptweird #javascriptwtf #javascriptsecrets #codingtips #javascriptshorts

https://www.youtube.com/watch?v=eP1S-b28YM4

void Operator Returns WHAT?! #javascripttricks

YouTube

Constructor Can Return DIFFERENT Object?!

Constructors can LIE about what they create! If you return an object, it REPLACES the instance. The 'new' keyword becomes USELESS. instanceof returns false! This breaks OOP principles!

#javascript #javascripttricks #constructor #classsyntax #instanceof #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #oopquirks #advancedjavascript

https://www.youtube.com/watch?v=NSHaq1zbSWE

Constructor Can Return DIFFERENT Object?! #javascriptshorts

YouTube

typeof Works in Temporal Dead Zone?!

Temporal Dead Zone has a LOOPHOLE! typeof works on undeclared variables (returns undefined) but throws ReferenceError for let/const. This inconsistency is INSANE!

#javascript #javascripttricks #tdz #temporaldeadzone #typeof #javascriptweird #javascriptquiz #codingchallenge #javascriptshorts #javascriptwtf #variablehoisting #advancedjavascript

https://www.youtube.com/watch?v=cAQaqNwFUL0

typeof Works in Temporal Dead Zone?! #JavaScript

YouTube

Array(3) vs [,,,] Are NOT The Same!

Creating arrays in JavaScript has a hidden trap! Array(3) and [,,,] look identical but behave completely differently. Mind blown!

#javascript #javascripttricks #codingtips #programmingtutorial #arrayconstructor #javascriptquiz #codingchallenge #javascriptshorts #javascriptbugs #sparsearrays #javascriptwtf #arraycreation

https://www.youtube.com/watch?v=Rm7V87ukelA

Array3 vs Are NOT The Same! #arrayconstructor

YouTube

Comma Operator Returns LAST Value Only?!

⚠️ THIS IS INSANE! The comma operator evaluates ALL expressions but returns ONLY the last one! (1,2,3,4,5) = 5! Used in for loops everywhere but nobody notices. Tag a dev who needs this!

#javascript #javascripttricks #codingchallenge #commaoperator #javascriptoperators #javascriptquiz #javascriptweird #javascriptwtf #forloops #codinginterview #javascriptshorts

https://www.youtube.com/watch?v=DEtGXfUIjsE

Comma Operator Returns LAST Value Only?! #codingchallenge

YouTube

with() Changes Variable Scope?!

💥 DEPRECATED BUT STILL WORKS! The 'with' statement changes your scope and makes variables magically refer to object properties! Banned in strict mode but still in old codebases. This caused HUGE security bugs!

#javascript #javascripttricks #codingchallenge #withstatement #scope #javascriptquiz #javascriptweird #javascriptwtf #deprecated #javascriptbugs #javascriptshorts

https://www.youtube.com/watch?v=pnuVGVN9Kfk

with Changes Variable Scope?! #javascriptwtf

YouTube