DEV Community

skptricks
skptricks

Posted on

The Basics Of ES6 Generators - Javascript

Post Link : The Basics Of ES6 Generators - Javascript

With ES6 generators, we have a different kind of function, which may be paused in the middle, one or many times, and resumed later, allowing other code to run during these paused periods.

The function* declaration (function keyword followed by an asterisk) defines a generator function, which returns a Generator object.

Syntax :
First, the new declaration syntax:
function *addnumber() {
// ...
}
The Basics Of ES6 Generators - Javascript

Read More ...

Top comments (0)