What if open source was more than just code?
Today, we're launching the first version of our platform.
Explore SylvenOS:
https://t.co/CoOCxLvg13
GitHub:
https://t.co/SllqKzWv80
Feedback, ideas, and contributions are always welcome.
#OpenSource#BuildInPublic#NextJS#SylvenOS
In Javascript, NaN is placeholder for mathematical error. Because 2 different errors have different origins & represent different invalid operations, NaN == NaN evaluates to false
Next time you see NaN, don't compare it. Validate it with Number.isNaN().
#sylvenos#javascript
Tricky JavaScript: 🤯
console.log(NaN == NaN); // false
Most developers expect : true
But the actual output is : false
Why?
Because NaN values have different origins.NaN just means "Not-a-Number"—it doesn't tell you what the invalid value actually was.
Compare: a == b
↓
Evaluate a: "SylvenOS" → NaN (Value 1)
Evaluate b: "@gauravsingh7x" → NaN (Value 2)
↓
Value 1 == Value 2
↓
false
Because both NaN values come from completely different operations, they are treated as entirely different, unequal values.
Execution Flow
3 > 2 > 1
true > 1
↓
1 > 1
↓
false ❌
The ">" operator is evaluated from left to right.
JavaScript does not interpret it as:
(3 > 2) && (2 > 1)
which is what many developers assume.
That's why the result is surprising 🤯
Tricky JavaScript 🤯
console.log(3 > 2 > 1);
Most developers expect: true
Because:
3 > 2
2 > 1
Both statements are true.
But the actual output is: false
Wait... How? 👀
🚨Anthropic just showed a 24-minute workshop on how to actually do prompts for Claude.
Taught by the people who built it.
Free. No registration. No paywall.
I've seen $300 courses that don't cover what they teach in the first 8 minutes.
Watch it and bookmark it now.
Interview Lesson🚀:
"var" behaves differently because of hoisting
But "let" and "const" stay in the Temporal Dead Zone until initialized.
That’s one of the most important JavaScript concepts every developer should know
#JavaScript#hoisting#TDZ#LexicalScope @gauravsingh7x
JavaScript Scope & Temporal Dead Zone Trap🤯
let x=10;
function test() {
let x=20;
console.log(x);
}
test();
O/P: 20
Why?👀
Because JavaScript follows Lexical Scope
let x=20 is created.
So JavaScript first looks for "x" inside the local scope.
It finds: 20 and stops searching
When JavaScript sees:
let x inside the function, it reserves memory for it immediately.
But until the line:
x = 20 is executed, the variable stays inside the TDZ.
So accessing it before initialization causes:
ReferenceError