Javascript Growth Population Problem --> Code Returning Wrong Answer : I have the following problem: 

In a small town the population is p0 = 1000 at the beginning of a year. The population regularly increases by 2 percent per year and moreover 50 new inhabitants per year come to live in the town. How many years does the town need to see its population greater or equal to p = 1200 inhabitants?


Below is my code: 

    function nbYear(p0, percent, aug, p) {
    
    
      for (var i=0; p0 < p; i++){
        p0 = p0 * (1 + percent/100) + aug; 
    
        return i
      }
    }
    
    
    nbYear(1000, 2, 50, 1200)

My solution return 0 which is wrong.  The correct answer is 3.  I know if I removed the {}, it will give me the right answer.  But I want to understand what is wrong with my code ... why is it returning 0?  