MCPcopy
hub / github.com/webpack/webpack / forEach

Method forEach

lib/RuntimeTemplate.js:501–507  ·  view source on GitHub ↗

* Returns for each code. * @param {string} variable variable * @param {string} array array * @param {string | string[]} body body * @returns {string} for each code

(variable, array, body)

Source from the content-addressed store, hash-verified

499 * @returns {string} for each code
500 */
501 forEach(variable, array, body) {
502 return this.supportsForOf()
503 ? `for(const ${variable} of ${array}) {\n${Template.indent(body)}\n}`
504 : `${array}.forEach(function(${variable}) {\n${Template.indent(
505 body
506 )}\n});`;
507 }
508
509 /**
510 * Returns comment.

Callers

nothing calls this directly

Calls 2

supportsForOfMethod · 0.95
indentMethod · 0.80

Tested by

no test coverage detected