Comment
Comment by marijn
This aligns with my experience with https://eloquentjavascript.net, except that I put it online before publishing on paper, and my hunch is that it wouldn't have reached anywhere near the level of fame (and thus sales) it did if it hadn't been available online.