Skip to content

Conversation

@cats256
Copy link
Contributor

@cats256 cats256 commented Jul 4, 2023

Because

Reformat test parameters allow for more consistency

This PR

Modified the test for the sum function in calculator.spec.js, as well as the sum and multiply functions in calculator-solution.spec.js file to expect rest parameters instead of expecting an array parameter. Modified the sum function in calculator-solution.js to work with the new test for the sum function. There was no need to modify the multiply function in calculator-solution.js as it already expects rest parameters

@cats256
Copy link
Contributor Author

cats256 commented Jul 15, 2023

@CouchofTomato hello I don't believe the maintainer is active in reviewing PR anymore right now

@thatblindgeye
Copy link
Contributor

@cats256 We definitely should align how the Odin solutions are written (either with rest params or passing in arrays). My only issue with using rest param instead of passing in an array for the exercise is I don't believe we really go over rest param other than as an additional resource (which isn't required reading).

I feel like if we want to go forward with this update, it may be worth moving "Fundamentals Part 5" additional resource to the assignment, so users will at least understand what the rest parameter is (this would be done in our curriculum repo).

The alternative is revert the update made to the multiply solution to accept an array.

@cats256
Copy link
Contributor Author

cats256 commented Jul 16, 2023

@cats256 We definitely should align how the Odin solutions are written (either with rest params or passing in arrays). My only issue with using rest param instead of passing in an array for the exercise is I don't believe we really go over rest param other than as an additional resource (which isn't required reading).

I feel like if we want to go forward with this update, it may be worth moving "Fundamentals Part 5" additional resource to the assignment, so users will at least understand what the rest parameter is (this would be done in our curriculum repo).

The alternative is revert the update made to the multiply solution to accept an array.

Alright I made the multiply solution to accept an array as well as the calculator.spec.js to expect an array parameter as well (pretty much the same as calculator-solution.spec.js but with test.skip and require ./calculator instead of ./calculator-solution). calculator-solution.spec.js is no longer changed since the original file was fine and expect an array instead of rest parameters for the multiply solution.

@thatblindgeye thatblindgeye merged commit 9599e2a into TheOdinProject:main Jul 20, 2023
Oussama5379 added a commit to Oussama5379/javascript-exercises that referenced this pull request Feb 1, 2025
Reformat test parameters for consistency
painooo pushed a commit to painooo/javascript-exercises that referenced this pull request Dec 29, 2025
Reformat test parameters for consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants