The F-35 IS expensive _per_unit_. The A-10 does one job, and there are several other aircraft that do different jobs. So the A-10 sits on the ground while there is air-to-air taking place, waiting while another aircraft handles that. IF the F-35 does four different roles, replacing four different types of aircraft, that cuts the effective cost by 75%. It wouldn't be parked on the tarmac waiting for a time when CAS in needed with uncontested skies. It could, supposedly, when the skies while also bombing enemy airfields , then do close air support.
Let's see how it actually does in testing before we declare the result.
The astronomical cost of the F-35 means that 1) we won't make that many of them and 2) we won't deploy that many of them. In the event of a free for all fight, having four separate aircraft doing four separate things is a good thing. It allows the pilots and support crews to concentrate on fewer issues. The F35 is going to have to be air support, AWACs and air to ground fighter. The theory behind the F35 is that it is so smart, it can deal with all of the issues from a lot further away. The slow development cycle of the plane means that it won't have all of it's capabilities for another ten years or so.
The idea of having one airframe play multiple roles only works if you make enough to do the job (and that it actually does all of the jobs reasonably well).