To dispatch a load event: element.dispatchEvent(new CustomEvent("load")). I can’t think of any practical example of dispatching a load event, but here’s a related example of dispatching an input event for a custom view: https://observablehq.com/@mbostock/scrubber
The single pipe is a bitwise OR. The Math.random() function produces a floating-point number in the range 0 to less than 1. Multiplying that result by 100 results in a number with an integer part and a fractional part. Applying the bitwise OR operator on a number x with zero yields x, but because the bitwise OR converts the operands to 32-bit integers, the fractional portion of x is truncated. So the pipe is making the result of (Math.random() * 100) an integer.