MCPcopy Index your code
hub / github.com/bigskysoftware/_hyperscript / forEach

Method forEach

tools/common/_hyperscript.iife.js:2546–2559  ·  view source on GitHub ↗
(value, func)

Source from the content-addressed store, hash-verified

2544 return value != null && value[SHOULD_AUTO_ITERATE_SYM] || this.#isArrayLike(value);
2545 }
2546 forEach(value, func) {
2547 if (value == null) {
2548 } else if (this.#isIterable(value)) {
2549 for (const nth of value) {
2550 func(nth);
2551 }
2552 } else if (this.#isArrayLike(value)) {
2553 for (var i = 0; i < value.length; i++) {
2554 func(value[i]);
2555 }
2556 } else {
2557 func(value);
2558 }
2559 }
2560 implicitLoop(value, func) {
2561 if (this.shouldAutoIterate(value)) {
2562 for (const x of value) func(x);

Callers 15

processNodeMethod · 0.95
extractCssClassesFunction · 0.45
addContainerMethod · 0.45
[Symbol.iterator]Method · 0.45
unifiedEvalMethod · 0.45
resolveMethod · 0.45
resolveMethod · 0.45
resolveMethod · 0.45
toggleMethod · 0.45
resolveMethod · 0.45
resolveMethod · 0.45

Calls 2

#isIterableMethod · 0.95
#isArrayLikeMethod · 0.95

Tested by

no test coverage detected