Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/besufekad-haz/recursion-challenge
https://github.com/besufekad-haz/recursion-challenge
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/besufekad-haz/recursion-challenge
- Owner: Besufekad-HAZ
- License: mit
- Created: 2023-03-24T07:18:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-24T07:36:56.000Z (almost 2 years ago)
- Last Synced: 2024-12-15T01:30:17.657Z (30 days ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## How to solve this challenge?
1. Read the "Challenge description" below.
2. Make changes to the [challenge.js](./challenge.js) file.
3. Commit your changes.
4. Wait for the result of the "GitHub Classroom Workflow" action. If it is green - congratulations, you solved this challenge! If not - try again!
5. *You can watch an example of how to solve a challenge in the video linked in the theoretical lesson preceding this challenge.*## Challenge description
### Basic Recursion
You will be given a positive integer number. Fill in the method sum so that it adds up all the positive integers up to number and returns the sum.
For example, when given 4 it should return 10 (4+3+2+1).While there are other ways to solve this challenge, you should use recursion to get the sum.
#### Examples
```js
console.log(sum(4))
// => (4 + 3 + 2 + 1) = 10console.log(sum(10))
// => 55
```Get stuck and need some hint?
Check this link: https://gitlab.com/microverse/guides/coding_challenges/hints/blob/master/challenges/recursion/basic-recursion.md### Troubleshooting
If you cannot see any auto-grading workflows on the [Actions](../../actions) page, learn how to fix it in [this repo](https://github.com/microverse-students/autograding-troubles-js/blob/main/README.md).