Old does not necessarily mean obsolete, A-10 still beats F-35s by a large margin on the job it's assigned to do, and cheaper
Do you know what A-10s have done for the majority of their missions in the last decade? Flown high with JDAMS and loitered, waiting for a call. The gun is all sexy, but just not used enough. And the A-10 would be crushed over a battlefield like Ukraine. Hell, even the B-1 was used for CAS missions in Afghan because it could get their fast, and had better loiter time than most other aircraft. Of course the wisdom of using $300M+ bombers in this manner is questionable.
My point wasn't that old is bad, but that all militaries use old gear. The new gear is often enhancements to old gear.
The F-35 likely exceeds the Warthog in other aspects, however.