Servants of the Lord promise in advance to express thankfulness after the Lord has answered their prayer. As such it is mentioned in the laws on offerings (Leviticus 7:16, Leviticus 22:18) and frequently in the Psalms (e.g., Psalm 22:26). It is not a matter of negotiating with God, striking a deal, or purchasing a favour. This is a general description; it does not presuppose that Jephthah meant his vow in the proper way.
30 And Jephthah made a vow to the LORD and said, “If you will give the Ammonites into my hand,