Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filles for the new rest and spread exericse #1989

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

meatball133
Copy link
Member

Resolve #1500

This is the start for the exercise. There is still some stuff that I haven't started on like hints and design.

It is because I think they require that the rest is more or less finished.

@github-actions
Copy link
Contributor

Dear meatball133

Thank you for contributing to the JavaScript track on Exercism! 💙
You will see some automated feedback below 🤖. It would be great if you can make sure your PR covers those points. This will save your reviewer some time and your change can be merged quicker.

  • 📜 The following files usually contain very similar content.

    • concepts/<concept>/about.md
    • concepts/<concept>/introduction.md
    • exercises/concept/<exercise>/.docs/introduction.md

    Please check whether the changes you made to one of these also need to be applied to the others.

  • 🧦 If you changed the function signature or the JSDoc comment in the exemplar file (.meta/exemplar.js) or the stub file (<exercise>.js), make sure the change is applied to both files.

  • ✍️ If your PR is not related to an existing issue (and is not self-explaining like a typo fix), please make sure the description explains why the change you made is necessary.

  • 🔤 If your PR fixes an easy to identify typo, if would be great if you could check for that typo in the whole repo. For example, if you found Unicdoe, use "replace all" in your editor (or command line magic) to fix it consistently.

Dear Reviewer/Maintainer

  • 📏 Make sure you set the appropriate x:size label for the PR. (This also works after merging, in case you forgot about it.)

  • 🔍 Don't be too nit-picky. If the PR is a clear improvement compared to the status quo, it should be approved as clear signal this is good to be merged even if the minor comments you might have are not addressed by the contributor. Further improvement ideas can be captured in issues (if important enough) and implemented via additional PRs.

  • 🤔 After reviewing the diff in the "Files changed" section, take a moment to think about whether there are changes missing from the diff. Does something need to be adjusted in other places so the code or content stays consistent?

Automated comment created by PR Commenter 🤖.

@meatball133 meatball133 marked this pull request as draft November 11, 2022 18:18
Copy link
Member

@junedev junedev left a comment

Choose a reason for hiding this comment

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

Thanks for getting started with the content. I reviewed the instructions file and left some comments.

exercises/concept/train-driver/.docs/instructions.md Outdated Show resolved Hide resolved
exercises/concept/train-driver/.docs/instructions.md Outdated Show resolved Hide resolved
exercises/concept/train-driver/.docs/instructions.md Outdated Show resolved Hide resolved

Your friend has been keeping track of how much each wagon weighs. Although they are not sure how many wagons and would like the data to be returned as an array.

```exercism/note
Copy link
Member

Choose a reason for hiding this comment

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

Note blocks should not be used for the normal instructions of the exercise, only for special things that need to stand out (like the note at the top about using rest and spread).

Applies to all the tasks.

exercises/concept/train-driver/.docs/instructions.md Outdated Show resolved Hide resolved
exercises/concept/train-driver/.docs/instructions.md Outdated Show resolved Hide resolved
@meatball133
Copy link
Member Author

I feel like I have resolved the issues mentioned above. If not please tell me and I will give it another round

@SleeplessByte
Copy link
Member

I feel like I have resolved the issues mentioned above. If not please tell me and I will give it another round

Thank you for the work!

We'll check it out.

@meatball133
Copy link
Member Author

meatball133 commented Nov 20, 2022

Could some one go through with me why errors are raised? The changes I made should not have caused this.

@meatball133 meatball133 marked this pull request as ready for review December 29, 2022 12:07
@SleeplessByte
Copy link
Member

Could some one go through with me why errors are raised? The changes I made should not have caused this.

Sorry I didn't see this. Seems you managed to solve this yourself!

For future contributions, on this track repository you can post a comment with / followed by format and it will format it on the PR directly.

@meatball133
Copy link
Member Author

meatball133 commented Jan 1, 2023

I see, no problem. But thanks for the tip.

I made some commits to some other tracks, so I learnt there how the config file needs to be setup.

@SleeplessByte SleeplessByte self-requested a review June 9, 2023 14:13
@SleeplessByte
Copy link
Member

I see, no problem. But thanks for the tip.

I made some commits to some other tracks, so I learnt there how the config file needs to be setup.

I'll pick up the reviewing here :)


## 1. Create a list of all wagons

- Multiple arguments in the function parameters can be packed with the `...<args>` operator.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Multiple arguments in the function parameters can be packed with the `...<args>` operator.
- Multiple arguments in the function parameters can be packed with the [`...<args>` (spread) syntax][spread-syntax].


## 2. Move the first two elements to the end of the array

- Using unpacking with the rest operator(`...`), lets you extract the first two elements of a `array` while keeping the rest intact.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Using unpacking with the rest operator(`...`), lets you extract the first two elements of a `array` while keeping the rest intact.
- You can unpack a series of parameters using [a destructuring assignment (`...`)][destructuring assignment].
This lets you extract the first two elements of a `array` while keeping the rest intact.

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.

Separate rest-and-spread into its own new concept exercise (concept exists)
3 participants