* 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)
| 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. |
nothing calls this directly
no test coverage detected