JavaScript
JavaScript copied to clipboard
Reverse
Describe your change:
- [X] 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 read CONTRIBUTING.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.jsis allowed butuserprofile.js,Userprofile.js,user-Profile.js,userProfile.jsare 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 contains
Fixes: #{$ISSUE_NO}.
Please...
- Name this
reverse- Use a proper JSDoc comment
- Why is your comment screaming at me?
- Don't use a
const Arrayin your tests (shadows the built-inArray) - just inline the arrays- Consider using
eachhere- Declare
tempasconstinside the loop
Just to be sure:
- You mean changing name files to 'Reverse.js' and 'Reverse.test.js' ? 2/3. Sorry I am still learning to being consistent
- 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
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's each for testing.
1. You mean changing name files to 'Reverse.js' and 'Reverse.test.js' ? 2/3. Sorry I am still learning to being consistentNot only the file names, also the function name.
2. For each wouldn't work because it loops over half arraySorry, I should've made myself more clear. I did not mean "use for-each for reversing". I meant use Jest's
eachfor 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
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


