Though God gave the victory, yet it is said Joshua discomfited Amalek, because Joshua was a type of Christ, and of the same name, and in him it is that we are more than conquerors.
Related Commentaries of Exodus 17:13
Exodus 17:13
13 And Joshua discomfited Amalek and his people with the edge of the sword.