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.
jquery
jQuery event binding internal
The event binding in jQuery is very interesting. It is designed with several goals. 1. It should works consistently across browsers. 2. It should allows attaching more than one handler function to a event....
Follow the thread
jquery
shadow copy in jQuery
We can use jQuery to copy(clone) an object to a new object, so the old object and the new object can evolved independently. //shadow copy object var oldObj = { name: "fred" }; var...
Follow the thread
javascript
copy array in javascript
var x = [1, 2];
var y = x.slice(0);
y[0] = 100; //y --> [100, 2]
alert(x[0]); //1
The new copy evolve independently of the old copy.
Follow the thread
jquery
Easy Setter Functions in jquery
One of the new feature in jQuery 1.4 is setter function. For a while now, you’ve been able to pass a function into .attr() and the return value of that function is set into...
Follow the thread
javascript
how to test whether a object has member
Object.prototype.hasMember = function (memberName)
{
return memberName in this;
Follow the thread