The J-31 is a twin-engine aircraft, and the F-35 is a single engine aircraft.
In fact, the slightly improved J-31 prototype (there are only two known to exist), which first flew in December 2016, was equipped with a cleaner burning WS-13 engine, among other improvements.
Beijing has even claimed that the J-31 will eventually have supercruise-capable WS-19 engines, giving it a leg up on the F-35.
Source: Popular Science, The Aviationist
But unlike the J-31, the F-35 has a sensor suite giving the pilot greater awareness of the battlefield and is basically a flying data hub that shares target tracking information.
"There is no indication that China’s J-31 has been able to fuse such a large variety of feeds into a singular manageable interface," Popular Science recently wrote. "That means the F-35’s ability to fight from beyond the horizon won’t be found in its Chinese knock-off."
As for how the J-31 will be used? Chinese military analysts have said that it will probably replace the J-15 as Beijing's primary carrier fighter.