Using an LM339 IC as a motor driver
The LM339 is a comparator, not a motor driver. The L239D is a dual H-bridge motor driver.

They are completely different things. One is used for comparing two voltages (up to 4 times, it's a "quad"), the other is used for driving motors.

The LM339 can output an absolute maximum of 20mA. That's half what the Arduino itself can output on an IO pin!

You could use the LM339 as part of the control circuitry to control a H-bridge, but it cannot itself drive a motor in any way, shape, or form.