This simply isn't true. It might be true in silicon valley or some other hipster magnets, but there's definitely a market for those of us who have been around for decades and been solving problems for decades.
I'm just starting out in my career, but I find the prospect of future me being devalued because he's a couple years older terrible, and I don't understand why others seem okay with it. Aging is going a second per second for everyone, isn't it?
As a young developer I watched great old developers, fantastic at their job and with super deep experience let go first.
My advice is make sure you save a lot. And be prepared to either retire early, switch careers, or start your own business/consult once you have over 10 years of experience. Connect with people, keep in touch, and make sure you stay current with new technologies.
Part of the reason why I ask is that most of the places that I have worked for respect experience more than youth, and couldn't care less if the firms that they were contracting work out to employed experienced developers in their 20's or their 50's.
Small companies, typically startups, are diverse. Some like hiring diamonds in the rough, which can include old developers. Other are obsessed with youth.
Starting your own business or consulting are standard and popular options for old developers.
As an industry insider, people complain as loudly as people from any industry. But just look at the actual unemployment and pay rates per industry. Few other industries are better.
I see resumes for similar aged people who know cold fusion and Delphi, and those that know JavaScript and Elixer.
I suspect interviews go very differently for the two groups.
I don't do web dev so I don't give a shit about javascript.
Sooner or later you'll start facing ageism. It is rampant. The interviewers will look younger, the interviews scarcer, the technology stack will move to a new shiny thing that is a rehash of ideas of previous fads of old, people will start using arguments like "fitting into the culture",...
I read somewhere a long ago that software developers have an half-life of 6 years. If you're long past that, better really start acquiring other skills.