Electrostatic field is a conservative field. Therefore, work done by the electric field does not depend on the path followed by the charge. It only depends on the position of the charge, from which and to which the charge has been moved.