Update Tutorial to use ES6 syntax to iterate over lines
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
The tutorial uses a for statement to iterate through an iterable Object in the calculateWinner helper function. This can be replaced with an es6 for ... of. The tangible benefit of using for ... of over for when you're working with an iterable object is that for ... of decreases the incidence of off-by-one errors.
I've prepared a fork for what this would look like here: https://github.com/reactjs/reactjs.org/compare/master...arg4:patch-2.
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the tutorial and locate the calculateWinner helper, then inspect the current for statement that iterates over the iterable object. Update that iteration to use ES6 for...of syntax and verify that the tutorial's behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100