This is a card in Dave's Virtual Box of Cards.

JavaScript

Page created: 2023-11-25
Updated: 2025-08-06

New for 2024: I also have a demonstration page for Textarea Syntax Highlighting.

I’ve done tons of JavaScript projects. Some highlights:

Where do JS prototypes come from?

From ARK (Smith) by way of Self (Smith and Ungar).

screenshot of an ungar slide bullet point reading Warehouse of prototypes instead of global name space of classes

Check out Randall Smith’s ARK system on my microworlds page.

The "good parts"

Like Douglas Crockford, I have my own idea of "JavaScript: The Good Parts".

I like two fundamental things about JavaScript.

The first thing is the object literal syntax:

var foo = {
    bar: "Hello",
    biz: "World",
    baz: [1,2,3,4],
};

The second are the first-class functions with closures:

function honk(x){
    return function emit(){
        alert(x);
    }
}

var honk1 = honk("Blooooop!");
var honk2 = honk("Blattt!");

honk1();
honk2();

Between those two building blocks, you can really construct absolutely anything in a huge variety of styles.

Most of what makes working with JavaScript unpleasant has more to do with the insanely bad browser APIs (many of which are way better now than they used to be), the NodeJS ecosystem, and the way people try to use JavaScript like Java with classes, inheritance, and all that nonsense. I don’t use the prototypal inheritance system at all, if I can help it.

I almost never use the this keyword if I can help it. If I do, it’s one line at the beginning of a callback and I get what I need from it and then leave it alone. Never trust this in some deeply nested code somewhere. It will always hurt you when you least expect it.

The tiny core of the language itself, if you use it consistantly and ignore the weird stuff, is actually extremely pleasant.