Alex Rivera | Logout

What's the yield keyword in JavaScript?

Asked 2010-02-17T15:55:30.913
325

I heard about a "yield" keyword in JavaScript. What is it used for and how do I use it?

Edit
Report

1 Answer

17

It's used for iterator-generators. Basically, it allows you to make a (potentially infinite) sequence using procedural code. See Mozilla's documentation.

answered 2010-02-17T15:58:44.937

Your Answer