#As the army went out, why did Jehoshaphat say to give thanks to Yahweh?

As they went out preceding the army, Jehoshaphat told them to say, "Give thanks to Yahweh; for his covenant faithfulness endures forever." [20:21]