Notes on software and the ideas behind it
Find the meaning
behind the code.
I’m Fred Yang. I write about software—how it works, why it behaves the way it does, and the ideas that make code easier to reason about.
Open the notebookWorking notes / 2026
Recently mapped
Architecture, reactivity, and the hidden relationships that shape frontend systems.
javascript
|| , && and !!
&& is guard operator aka "logical and", and || is default operator "aka logical or", we normally see the code like the following if ( condtion1 && condition2) { } if (condition1 || condition2)...
Follow the thread
field note
test
test
Follow the thread
javascript
context of setTimeout and eval
setTimeout is a method of window object. “this” context refer to the window. But you can change its context in the following way. setTimeout does not support call method. setTimeout(function() { alert(this); }, 0);...
Follow the thread
javascript
Anonymous function's contexgt
var name = "window";
var f = (function() { alert(this.name); });
f(); //window
f.name = "local";
f(); //still window, the function still run in the context of window
f.call(f); //local
Follow the thread
javascript
== vs ===
Here is the msdn documentation Equality (==, !=) If the types of the two expressions are different, attempt to convert them to string, number, or Boolean. NaN is not equal to anything including itself....
Follow the thread