The rendering in the margin is better. Cf. Deuteronomy 20:4.
Related Commentaries of Exodus 23:22
Exodus 23:22
22 But if thou shalt indeed obey his voice, and do all that I speak; then I will be an enemy unto thine enemies, and an adversaryg unto thine adversaries.