TheOdinProject / javascript-exercises

MIT License
1.28k stars 34.52k forks source link

08_calculator: Remove redundant solution code #499

Closed DavidStaus closed 1 month ago

DavidStaus commented 1 month ago

Because

The solution includes a guard clause that does not change the functionality of the function. The variable "product" is declared with a value of 1, so in the case of 'n === 0' the for loop won't run (let i = n; i > 0), and it will return product with the declared value of 1

This PR

Issue

Additional Information

https://discord.com/channels/505093832157691914/690590001486102589/1296871107109982208

Pull Request Requirements