The F-35 is probably a better #fighter, on the whole, than the current version of the JAS 39. The F-47 will probably be better than the next version. But the best plane is the one you can get in the air.
Export restrictions, maintenance requirements, and the possibility of a "kill switch" make any US-built military aircraft a terrible bet for most customers. If Saab can find an alternate engine (the current powerplant is built by General Electric) then the #Gripen becomes a clearly better choice.
Saab claims its #ECM capabilities can be upgraded to make it the equal of any "stealth fighter." I don't know enough to evaluate this claim. I do know that if I were in charge of defense acquisitions for anywhere outside the US, I'd be willing to toss a coin to find out.
https://www.eurasiantimes.com/saab-offers-full-capability-jas-39-gripens-amid/