Loops/While: Difference between revisions
m
→minor edit to text
Line 740:
}</lang>
In a functional idiom of JavaScript, however, we can not use a
Instead, we can define a composable loopWhile() '''function''' which has no side effects, and takes 3 arguments:
:#An initial value
:#A function which returns some derived value, corresponding to the body of the While loop
:#A conditional function, corresponding to the While test
<lang JavaScript>function loopWhile(varValue, fnDelta, fnTest) {
|