We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be useful to have some practice tasks with realization of concepts in article Iterables.
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; }
The text was updated successfully, but these errors were encountered:
Maybe something more practical? Not sure a task is really needed there. People rarely make iterables manually.
Sorry, something went wrong.
We can add something simple and potentialy useful.
No branches or pull requests
It would be useful to have some practice tasks with realization of concepts in article Iterables.
An idea of task is in the article: "make an iterable object that generates an infinite sequence of pseudorandom numbers".
Possible solution:
The text was updated successfully, but these errors were encountered: