MCPcopy Index your code
hub / github.com/nodejs/node / takeWhile

Function takeWhile

test/fixtures/snapshot/typescript.js:2572–2579  ·  view source on GitHub ↗
(array, predicate)

Source from the content-addressed store, hash-verified

2570 }
2571 ts.padRight = padRight;
2572 function takeWhile(array, predicate) {
2573 var len = array.length;
2574 var index = 0;
2575 while (index < len && predicate(array[index])) {
2576 index++;
2577 }
2578 return array.slice(0, index);
2579 }
2580 ts.takeWhile = takeWhile;
2581 /**
2582 * Removes the leading and trailing white space and line terminator characters from a string.

Callers

nothing calls this directly

Calls 2

sliceMethod · 0.65
predicateFunction · 0.50

Tested by

no test coverage detected