microsoft / Web-Dev-For-Beginners

24 Lessons, 12 Weeks, Get Started as a Web Developer
https://microsoft.github.io/Web-Dev-For-Beginners/
MIT License
82.28k stars 12.27k forks source link

fix calculateColor function #1121

Open konradrydzak opened 1 year ago

konradrydzak commented 1 year ago

Fix sorting co2Scale to not be in place, change finding scaleIndex to be equal to closestNum (not greater than).

Previously co2Scale was sorted in place and scaleIndex was taken for a value greater than closestNum (if one existed, otherwise it would return -1). After the changes, scaleIndex should correctly get the exact index of the closestNum value in co2Scale.

Probably also requires the same changes to Web-Dev-For-Beginners/5-browser-extension/solution/ and Web-Dev-For-Beginners/5-browser-extension/3-background-tasks-and-performance/translations/.

github-actions[bot] commented 1 year ago

This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.

abrilurena commented 8 months ago

looks awesome! thanks @konradrydzak ✨

I'm adding @saragibby here ♥️