Agree this is good advice a lot of the time. But just to offer an alternative possibility, there are other things that can affect the equation too. For instance, if you end up at the right startup you might learn a lot more than you would in the same amount of time at the alternative company. If you gave up $20k over 2 years by making, say, $100 instead of $110k at the startup, but then are able to jump to a job making $200k (which would have taken you much longer to work up to at the alternative company), you're a lot better off.
It still comes with some risk obviously, the startup could end up not going anywhere and you not learning much. But it's not nearly the risk of rolling the dice on equity.
I agree in broad strokes, in that I did exactly that with my last company. My first full-time programming job was as hire #1 as a tech startup (I was fired last month after two years) and while I'm now consulting, the full-time offers I'm receiving amount to a 50% pay raise, partly because I was able to build up so much experience in hot areas like Akka and Docker.
It still comes with some risk obviously, the startup could end up not going anywhere and you not learning much. But it's not nearly the risk of rolling the dice on equity.