From 187b317e891a4eedfd8f1e16c773e7520e1850f2 Mon Sep 17 00:00:00 2001 From: Rafael Kraut <14234815+RafaelKr@users.noreply.github.com> Date: Fri, 27 Oct 2023 14:30:26 +0200 Subject: [PATCH 1/2] Improve ch03-05-control-flow collection looping wording This makes it clearer, that you COULD use a `while` loop to loop a collection, but a `for` loop is the preferred way --- src/ch03-05-control-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch03-05-control-flow.md b/src/ch03-05-control-flow.md index 60d6b95a96..aac0e0c653 100644 --- a/src/ch03-05-control-flow.md +++ b/src/ch03-05-control-flow.md @@ -297,7 +297,7 @@ evaluates to `true`, the code runs; otherwise, it exits the loop. #### Looping Through a Collection with `for` -You can choose to use the `while` construct to loop over the elements of a +You could choose to use the `while` construct to loop over the elements of a collection, such as an array. For example, the loop in Listing 3-4 prints each element in the array `a`. From 62572d1b09fe69bf9420ff7ca4592e11e1849707 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Wed, 27 Mar 2024 12:19:03 -0600 Subject: [PATCH 2/2] Slight wording clarification in ch. 3.5 about for loops --- src/ch03-05-control-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ch03-05-control-flow.md b/src/ch03-05-control-flow.md index aac0e0c653..34b8372f34 100644 --- a/src/ch03-05-control-flow.md +++ b/src/ch03-05-control-flow.md @@ -297,7 +297,7 @@ evaluates to `true`, the code runs; otherwise, it exits the loop. #### Looping Through a Collection with `for` -You could choose to use the `while` construct to loop over the elements of a +You can also use the `while` construct to loop over the elements of a collection, such as an array. For example, the loop in Listing 3-4 prints each element in the array `a`.