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 notebook

Working notes / 2026

Recently mapped

Architecture, reactivity, and the hidden relationships that shape frontend systems.

javascript

triming leading and trailing whitespace in javascript

var result = text.replace( /^(\s|\u00A0)+|(\s|\u00A0)+$/g, "" )
Follow the thread
javascript

What is javascript

Here is how Douglas Crockford defined javascript Javascript is a functional language with dynamic objects and familiar syntax. In his definition, he stressed the most important feature of javascript is functional language(scheme), secondary important...
Follow the thread
javascript

adding a new memeber to all objects in javascript

function Person(){}
Follow the thread
javascript

How to tell type of an object in javascript

We can use typeof, instanceof, and constructor to tell type of an object. But they have different effect. The "typeof" operator will return "object" for all custom types . "instanceof" will return true, if...
Follow the thread
javascript

a merge function

function merge(root){ for ( var i = 0; i < arguments.length; i++ ) for ( var key in arguments[i] ) root[key] = arguments[i][key]; return root; }
Follow the thread