A partial wave analysis is presented of J/ψ→ϕπ+π− and ϕK+K− from a sample of 58M J/ψ events in the BES II detector. The f0(980) is observed clearly in both sets of data, and parameters of the Flatt\' e formula are determined accurately: M=965±8 (stat) ±6 (syst) MeV/c2, g1=165±10±15 MeV/c2, g2/g1=4.21±0.25±0.21. The ϕππ data also exhibit a strong ππ peak centred at M=1335 MeV/c2. It may be fitted with f2(1270) and a dominant 0+ signal made from f0(1370) interfering with a smaller f0(1500) component. There is evidence that the f0(1370) signal is resonant, from interference with f2(1270). There is also a state in ππ with M=1790−30+40 MeV/c2 and Γ=270−30+60 MeV/c2; spin 0 is preferred over spin 2. This state, f0(1790), is distinct from f0(1710). The ϕKKˉ data contain a strong peak due to f2′(1525). A shoulder on its upper side may be fitted by interference between f0(1500) and f0(1710).