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

Method forEach

www/js/_hyperscript.js:2559–2572  ·  view source on GitHub ↗
(value, func)

Source from the content-addressed store, hash-verified

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

Callers 13

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