MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / forEach

Method forEach

www/js/_hyperscript-max.js:2558–2571  ·  view source on GitHub ↗
(value, func)

Source from the content-addressed store, hash-verified

2556 return value != null && value[SHOULD_AUTO_ITERATE_SYM] || this.#isArrayLike(value);
2557 }
2558 forEach(value, func) {
2559 if (value == null) {
2560 } else if (this.#isIterable(value)) {
2561 for (const nth of value) {
2562 func(nth);
2563 }
2564 } else if (this.#isArrayLike(value)) {
2565 for (var i = 0; i < value.length; i++) {
2566 func(value[i]);
2567 }
2568 } else {
2569 func(value);
2570 }
2571 }
2572 implicitLoop(value, func) {
2573 if (this.shouldAutoIterate(value)) {
2574 for (const x of value) func(x);

Callers 15

processNodeMethod · 0.95
addContainerMethod · 0.45
[Symbol.iterator]Method · 0.45
unifiedEvalMethod · 0.45
#resolveSpecifiersMethod · 0.45
resolveMethod · 0.45
resolveMethod · 0.45
resolveMethod · 0.45
toggleMethod · 0.45
resolveMethod · 0.45
resolveMethod · 0.45
initLiveTemplatesFunction · 0.45

Calls 2

#isIterableMethod · 0.95
#isArrayLikeMethod · 0.95

Tested by

no test coverage detected