Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

algorithm: reverse#1197

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
raklaptudirm merged 10 commits intoTheAlgorithms:masterfromSczSca:InvertArray
Oct 20, 2022
Merged

Conversation

SczSca
Copy link
Contributor

Describe your change:

  • Add an algorithm: Invert Array.
    Algorithm to invert elements in an array:
    [a,b,c,d] //output [d,c,b,a]

Checklist:

  • [ X] I have readCONTRIBUTING.md.
  • [X ] This pull request is all my own work -- I have not plagiarized.
  • [ X] I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • [X ] All new JavaScript files are placed inside an existing directory.
  • [ X] All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed butuserprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • [ X] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message containsFixes: #{$ISSUE_NO}.

Copy link
Collaborator

@appgurueuappgurueu left a comment

Choose a reason for hiding this comment

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

Please...

  1. Name thisreverse
  2. Use a proper JSDoc comment
  3. Why is your comment screaming at me?
  4. Don't use aconst Array in your tests (shadows the built-inArray) - just inline the arrays
  5. Consider usingeach here
  6. Declaretemp asconst inside the loop

@SczSca
Copy link
ContributorAuthor

Please...

  1. Name thisreverse
  2. Use a proper JSDoc comment
  3. Why is your comment screaming at me?
  4. Don't use aconst Array in your tests (shadows the built-inArray) - just inline the arrays
  5. Consider usingeach here
  6. Declaretemp asconst inside the loop

Just to be sure:

  1. You mean changing name files to 'Reverse.js' and 'Reverse.test.js' ?
    2/3. Sorry I am still learning to being consistent
  2. For each wouldn't work because it loops over half array

Sorry for these mistakes, I'm a beginner student that heard and is learning about the open-source software

@appgurueu
Copy link
Collaborator

1. You mean changing name files to 'Reverse.js' and 'Reverse.test.js' ?   2/3. Sorry I am still learning to being consistent

Not only the file names, also the function name.

2. For each wouldn't work because it loops over half array

Sorry, I should've made myself more clear. I did not mean "use for-each for reversing". I meant use Jest'seach for testing.

@SczScaSczSca changed the titleInvert arrayReverseOct 18, 2022
@SczSca
Copy link
ContributorAuthor

1. You mean changing name files to 'Reverse.js' and 'Reverse.test.js' ?   2/3. Sorry I am still learning to being consistent

Not only the file names, also the function name.

2. For each wouldn't work because it loops over half array

Sorry, I should've made myself more clear. I did not mean "use for-each for reversing". I meant use Jest'seach for testing.

Everything is done, I guess.
Sorry for the inconveniences and the amount of commits made. I'm a beginner student that heard a talk about open-source software in Hacktoberfest and wanted to give it a try with some code that was made in one of my classes

Copy link
Collaborator

@appgurueuappgurueu left a comment

Choose a reason for hiding this comment

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

You forgot to rename the files...

@SczSca
Copy link
ContributorAuthor

You forgot to rename the files...

the renamed file names are not reflected on the last two commits? I see te files renamed, but I might be wrong

image

image

image

@raklaptudirmraklaptudirm changed the titleReversealgorithm: reverseOct 20, 2022
@raklaptudirmraklaptudirm merged commit636017c intoTheAlgorithms:masterOct 20, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@appgurueuappgurueuappgurueu approved these changes

@raklaptudirmraklaptudirmraklaptudirm approved these changes

@syedjafersyedjaferAwaiting requested review from syedjafer

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@SczSca@appgurueu@syedjafer@raklaptudirm

[8]ページ先頭

©2009-2025 Movatter.jp