time-to-botec/js/node_modules/@stdlib/utils/do-while/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

39 lines
923 B
Plaintext

{{alias}}( fcn, predicate[, thisArg] )
Invokes a function while a test condition is true.
The condition is evaluated *after* executing the provided function; thus,
`fcn` *always* executes at least once.
When invoked, both the predicate function and the function to invoke are
provided a single argument:
- `i`: iteration number (starting from zero)
Parameters
----------
fcn: Function
The function to invoke.
predicate: Function
The predicate function which indicates whether to continue invoking a
function.
thisArg: any (optional)
Execution context for the invoked function.
Examples
--------
> function predicate( i ) { return ( i < 5 ); };
> function beep( i ) { console.log( 'boop: %d', i ); };
> {{alias}}( beep, predicate )
boop: 0
boop: 1
boop: 2
boop: 3
boop: 4
See Also
--------