From 42fa0f2fb0d2ad8d60f5adb499c4f03b6f611a9b Mon Sep 17 00:00:00 2001 From: Sai Krishna Reddy <117559736+saikrishna488@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:58:21 -0600 Subject: [PATCH] Introduce standard 'for' loop in iteration section Added explanation and syntax for the standard 'for' loop. --- common-content/en/module/js2/iteration/index.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common-content/en/module/js2/iteration/index.md b/common-content/en/module/js2/iteration/index.md index 980534b18..735a8320f 100644 --- a/common-content/en/module/js2/iteration/index.md +++ b/common-content/en/module/js2/iteration/index.md @@ -16,7 +16,17 @@ To solve the sub-goal, we have to repeatedly add each number in the array to the In programming, we can **iterate** by using a {{}}A loop is a sequence of instructions that is continually repeated until some condition is reached.{{}}. -In particular, we can use a [`for...of` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) to sum the elements of the array. +### The Standard `for` Loop + +Before we look at shortcuts, it is important to understand the **standard `for` loop**. It gives you complete control over how the loop starts, when it stops, and how it moves to the next step. + +Here is the syntax: + +```js +for (let i = 0; i < 5; i++) { + console.log("Iteration number: " + i); +} +``` ```js function calculateMean(list) {