Saved Bookmarks
| 1. |
What is a generator in JavaScript and when to use it? |
|
Answer» In JavaScript, generators are those FUNCTIONS which can be exited and re-entered later on. Their variable bindings shall be SAVED across the re-entrances. They are written using the function* syntax. The Generator function should be used when:
JavaScript is a high-level, multi-paradigm programming language which conforms to the ECMAScript specification. Read our list of advanced javascript interview questions to get a deep understanding of this language. |
|