javascript-tutorial / javascript-tutorial/en.javascript.info

Suggestion. Task for 'Iterables' article

Open
#2,206 2 comments 0 reactions 0 assignees View on GitHub
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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.