Imaging you (for any reason) need to draw some color area of complicated form in HTML canvas, and then cut a piece of it, like a donut.
There is code sample for this trick:
ctx.beginPath(); // start path drawing
ctx.moveTo(startX, startY);
for (let point of points) {
ctx.lineTo(