The F-35 have in excess of 28000 lbf dry and the Gripen Demo have about 15000 lbf dry.
This makes it look like the F-35 should outrun the Gripen any time, still the official figures does not confirm this. Why?
This is my five cent:
The wing is about the same size, the length of the aircrafts are comparable but when you look at the aircrafts head on something else dawns: the Gripen has a tiny frontal area compared to the F-35 and even that is not the whole truth, since there is a major coke bottle shaping starting behind the canards.
This means that even if the skin friction is comparable and the shape friction is not that much better for the Gripen, the wave drag will be much less.
There are thousands of other details, like the thrust characteristics of the engine, wing thickness, mach cone, weights and stuff, but slenderness is always good when you wants to go fast.
*Well, I'm pretty sure that the F-35 can supercruise to some extent, but I think it will only be in a limited temperature and altitude envelope.