From c4a427c4579d432ba7b392706aa5f81922ee88ca Mon Sep 17 00:00:00 2001 From: Oumaima Fisaoui <48260689+Oumaimafisaoui@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:38:32 +0100 Subject: [PATCH] Chore(listed): Add a hint for the third instruction and clarify the first --- subjects/AI.GO/listed/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/subjects/AI.GO/listed/README.md b/subjects/AI.GO/listed/README.md index 7bd2310c0..f445a9283 100644 --- a/subjects/AI.GO/listed/README.md +++ b/subjects/AI.GO/listed/README.md @@ -42,7 +42,7 @@ let batteryLevels = [80, 60, 90, 50]; ### Indexes in Arrays -The position of an element in an array is called its index, starting from 0. So, our `batteryLevels` array is roughly equivalent to writing this object: +The position of an element in an array is called its `index`, starting from `0`. So, our `batteryLevels` array is roughly equivalent to writing this object: ```js let batteryLevelsObject = { @@ -109,7 +109,7 @@ Now, the array looks like this: #### Task 1: -You must declare a variable `components` that contains 4 strings, one for each robot component "motor", "sensor", "battery" and "camera" (respect that order). +You must declare a variable `components` that contains 4 strings, one for each robot component : `"motor"`, `"sensor"`, `"battery"` and `"camera"` (respect that order). #### Task 2: @@ -128,7 +128,7 @@ We provide you a variable `robotParts` that contains some elements. You will hav #### Task 3: -You must replace the third element of the provided `replaceComponents` array with the string 'enhanced'. +- You must replace the third element of the provided `replaceComponents` array with the string 'enhanced'. Example: @@ -137,7 +137,9 @@ let replaceComponents = ["motor", "sensor", "battery"]; // expect -> ['motor', 'sensor', 'enhanced'] ``` -You must swap the first and second element of the provided `swapComponents` array. +- You must `swap` the first and second element of the provided `swapComponents` array using a variable `temp`. + +_Hint: Use a `temp` variable to store the first element, assign the second element to the first, and then assign `temp` to the second element to complete the swap._ Example: