And Jehoash did what was right in the eyes of the LORD all his days, because Jehoiada the priest instructed him.
The general account here given of Joash is, 1. That he reigned forty years. As he began his reign when he was very young, he might, in the course of nature, have continued much longer, for he was cut off when he was but forty-seven years old, Kg2 12:1. 2. That he did that which was right as long as Jehoiada lived to instruct him, Kg2 12:2.
Commenting on 2 Kings 12:1-3
And Jehoash did that which was right in the sight of the Lord all his days,.... Worshipping the only true God, and ruling and walking according to the law of God: wherein Jehoiada the priest instructed him; and so long as he observed his instructions, and as long as that priest lived, he reigned well; for to that period "all his days must be limited"...
And Jehoash did [that which was] right in the sight of the LORD all his days wherein Jehoiada the priest instructed him. (a) As long as rulers give ear to the true ministers of God, they prosper.