var declarations are hoisted and initialised to undefined, so reading one before its line is legal and quietly wrong. let and const are hoisted too — the common…
Building a string out of several variables in JavaScript has meant a chain of + and a careful audit of the spaces. Backtick strings interpolate directly and, more…
Binding a handler directly to elements binds it to the elements that exist at that moment. Replace the list through Ajax and every handler goes with the old…
indexOf only works when you already have the value you are looking for. Finding the first element matching a predicate has meant either a filter() that builds a…
Converting a NodeList or an arguments object into a real array has been Array.prototype.slice.call(x) for a decade — an incantation that works because of how slice was specified…