TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
10.11k stars 13.54k forks source link

JS Basics- Problem Solving: Fix incorrect interpretation #29049

Closed bhagyeshsp closed 1 week ago

bhagyeshsp commented 2 weeks ago

The current explanation tells that the loop continues until the value of i is greater than the value of answer. But in fact, the parameter condition is i <= answer. Hence, the correction.

Because

The incorrect interpretation of i <= answer condition is fixed.

This PR

Issue

Closes #XXXXX

Additional Information

Pull Request Requirements

MaoShizhong commented 1 week ago

The current wording is correct. The condition part of a loop tells us the condition that the loop keeps going. So i <= answer means "keep looping while i is less than or equal to answer" which is the same as "loop until i is greater than answer".

bhagyeshsp commented 1 week ago

Oops! Apologies for raising the false flag. I will have to double-triple check before raising the PR in the future. Thanks for the explanation.