Skip to content

New solution to match updated test syntax - #364

Merged
codyloyd merged 2 commits into
TheOdinProject:mainfrom
fruddenfeldt:dev
Jun 7, 2023
Merged

New solution to match updated test syntax#364
codyloyd merged 2 commits into
TheOdinProject:mainfrom
fruddenfeldt:dev

Conversation

@fruddenfeldt

Copy link
Copy Markdown
Contributor

See separate PR "Removed array syntax in multiply test #359"

#359

Because

Updated the solution for the multiply function with one that does not take arrays as input.

This PR

There may be more elegant ways to write this function, but it passes the test as long as the [brackets] are removed.

Issue

Closes #XXXXX

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this PR follows the location of change: brief description of change format, e.g. 01_helloWorld: Update test cases
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If this PR includes changes that needs to be updated on the solutions branch, I have created another PR (and linked it to this PR).

See separate PR "Removed array syntax in multiply test TheOdinProject#359"  

TheOdinProject#359

@codyloyd codyloyd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine... but i have a couple of very nitpicky requests.

};
const multiply = function(...args){
let sum = 1
for (let i = 0; i < args.length; i++) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really nitpicky.. but can you fix the indentation on this line please.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made both changes through the 'edit' function here now. Hope that works, otherwise let me know if I need to open a new PR.

: 0;
};
const multiply = function(...args){
let sum = 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nitpicky: can we call this variable product

"product" is the result of multiplying numbers.. "sum" is for adding. this doesn't matter toooo much, but since this is example code we're going to have thousands of students looking at... we want it to be as clean and correct as possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; no problem, will do. Thanks!

@codyloyd

codyloyd commented Jun 7, 2023

Copy link
Copy Markdown
Member

we're good to go!

thanks

@codyloyd
codyloyd merged commit 8692f0e into TheOdinProject:main Jun 7, 2023
Oussama5379 added a commit to Oussama5379/javascript-exercises that referenced this pull request Feb 1, 2025
New solution to match updated test syntax
painooo pushed a commit to painooo/javascript-exercises that referenced this pull request Dec 29, 2025
New solution to match updated test syntax
Paodpdro pushed a commit to Paodpdro/javascript-exercises that referenced this pull request May 19, 2026
New solution to match updated test syntax
FredTheJanitor pushed a commit to FredTheJanitor/javascript-exercises that referenced this pull request May 29, 2026
New solution to match updated test syntax
FredTheJanitor pushed a commit to FredTheJanitor/javascript-exercises that referenced this pull request May 29, 2026
New solution to match updated test syntax
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