javascript-tutorial / javascript-tutorial/en.javascript.info
Suggestion. Task for 'Iterables' article
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 25.5k
- Forks
- 4k
- PR merge metrics
- No merged PRs in 30d
Description
It would be useful to have some practice tasks with realization of concepts in article [Iterables](https://javascript.info/iterable).
An idea of task is in the article: "make an iterable object that generates an infinite sequence of pseudorandom numbers".
Possible solution:
```
let randomObj = {
min: 10,
max: 100,
}
randomObj[Symbol.iterator] = function() {
return {
start: this.min,
end: this.max,
next() {
return {
done: false,
value: Math.random() * (this.end - this.start) + this.start,
};
}
}
}
const THRESHOLD = 20;
for (let value of randomObj) {
alert(value); // show random generated value
if (value < THRESHOLD) break;
}
````
Contributor guide
No contributing guide indexed for this repository
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
Start by reading the linked Iterables article and its existing exercise structure. Use the proposed infinite pseudorandom-number iterable as the task reference, then check how practice tasks are organized elsewhere in the tutorial. Done means the article includes an appropriate practice task with a clear prompt and solution guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100