Dear Student,
Work done in an electric field by shifting of any charge q from a point A (potential V1) to a point B(potential V2) is given by
Here, Electric field and displacement both are vector quantities but there dot product of both cancels the effect of the path taken and causes it to depend only on the initial final situations
This Proves that Work Done by an electric charge is a State function i.e. it depends on the final and initial state of the charge and not on the path is taken.
Regards.