CSS attribute on img filter: invert(); negates colours for a good cheap dark-mode, without editing the image itself, as in e.g. Anki templates
CSS to automatically comma-separate items in a container, like Python's ", ".join(l): #parent > span ~ span::before { content: ", "; }
a div extends from left edge to right edge, full width, unless its width is explicitly set in CSS, hence a bias in relative positioning on large screens
for reasons i struggle to grasp, the following line in <head> is very important to help a page look right on mobile: <meta name="viewport" content="width=device-width, initial-scale=1.0">
Array.some() and Array.every() work vaguely like Python any() and all(), respectively
arr.concat(other) works like Python's + on lists, to join Arrays
iterate indices in an Array with for (const i in arr) { ... }
Element.append() and Element.appendChild() are mostly the same, but .append() is more flexible and thus recommended
access the clipboard for automatic copy/paste with navigator.clipboard.writeText() and readText(), which are only available "shortly after" a user interaction
to make a label element fill a td for better clicking td { padding: 0; } td > label { display: block; width: 100%; height: 100%; }
draw a circle in a CanvasRenderingContext2D with ctx.arc(x, y, rad, 0, Math.PI * 2) between ctx.beginPath() and ctx.fill() or ctx.stroke() clear the canvas with ctx.clearRect(0, 0, canvas.width, canvas.height)
Element.onclick receives a MouseEvent, of which some prominent properties are button, offsetX, offsetY, ctrlKey, shiftKey while MouseEvent.button == 2 on a right-click, the typical browser doesn't make a click event for that, but a contextmenu event, handled separately
Array.flatMap((elem, ind, arr) => [...]) lets you yield a variable number of elements in the mapped array per input element, as by alternating 0 and 1 outputs per input
remove a segment from an Array with arr.splice(index, count)
[...Array(n)] works like Python n * [None], which can convert with Array.map to a list-comprehension on range(n)
HTML <cite> element italicises text like <em> or <i>, but semantically indicates titles of cited works