OpenSource For You

Control flow

-

JavaScript has run-to-completion semantics, which means the sequence of instructio­ns is executed from first to last. Conditiona­l and looping statements change the flow. Functions get executed from the first instructio­n to the last, except when a return or an exception is encountere­d inbetween. Generators introduce a mechanism where control is switched back and forth between the calling code and the generator function. The calling code is the controller function. A generator function has multiple entry points. It resumes from where it gave control to the calling function or instructio­n.

Newspapers in English

Newspapers from India