Daisy Chains, the Undead, and JavaScript Functions

JavaScript processes functions, and so on, from the left, so, while you can do it in multiple lines like a horde spreading out in ranks, you could also daisy chain functions together like: document.getElementById(“list”).appendChild( listOfHumanRefuges ); JavaScript will take the document object and run the getElementById on it. When getElementById returns an element, it’ll then... Read More

When 2 + 2 is actually 22

A common place where JavaScript’s internal typing system happens is when you try to add a number (2) and a string that looks like a number (“2”). In JavaScript, 2 + “2” is “22”. Since one of these is a string, it casts/treats the other as a string too and puts them together or concatenates them.... Read More

Two Kinds of Web Components

There are two kinds of web components: autonomous (name your own element) and customized built in elements (supercharge an existing element). Note: Safari does not support customized built in elements, but all other browsers do. Custom elements require a dash in their name and some JavaScript. Custom built in elements need the is attribute and... Read More