workshopper / learnyounode

Learn You The Node.js For Much Win! An intro to Node.js via a set of self-guided workshops.
Other
7.24k stars 1.84k forks source link

Update solution.js #709

Open pdwarkanath opened 4 years ago

pdwarkanath commented 4 years ago

Using reduce rather than a loop

ccarruitero commented 4 years ago

Hi @pdwarkanath

Thanks for your PR.

Your changes are not passing the linter, because the semicolon.

Personally, I think the for loop could be more easy to understand for a beginner developer.

Maybe this could be added as an alternative solution in test folder. What do you think?

pdwarkanath commented 4 years ago

@ccarruitero Sure. Should I just add this as alternate_01.js file to the test folder?

ccarruitero commented 4 years ago

@pdwarkanath following the pattern used for other files there, the file should be named valid_02.js

Make sure run npm test in your local machine to ensure linter and tests are passing.