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

Function main

benchmark/es/foreach-bench.js:50–73  ·  view source on GitHub ↗
({ n, count, method })

Source from the content-addressed store, hash-verified

48}
49
50function main({ n, count, method }) {
51 const items = new Array(count);
52 let fn;
53 for (let i = 0; i < count; i++)
54 items[i] = i;
55
56 switch (method) {
57 case 'for':
58 fn = useFor;
59 break;
60 case 'for-of':
61 fn = useForOf;
62 break;
63 case 'for-in':
64 fn = useForIn;
65 break;
66 case 'forEach':
67 fn = useForEach;
68 break;
69 default:
70 throw new Error(`Unexpected method "${method}"`);
71 }
72 fn(n, items, count);
73}

Callers

nothing calls this directly

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…