From e6cae928fe9649684f448c12dc1186628d77158e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:45:42 +0200 Subject: [PATCH 01/93] Update README.md --- exercises/01-Hello_World/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/01-Hello_World/README.md b/exercises/01-Hello_World/README.md index 8005a9c6..745bce59 100644 --- a/exercises/01-Hello_World/README.md +++ b/exercises/01-Hello_World/README.md @@ -4,11 +4,11 @@ tutorial: https://www.youtube.com/watch?v=miBzmGgMIbU # `01` Hello World -In JavaScript, we use `console.log` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called `the console`. +In JavaScript, we use `console.log()` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called **the console**. -Every language has a console, as it was the only way to interact with the users at the beginning (before the Windows or MacOS arrived). +Every language has a console, as it was the only way to interact with the users at the beginning (before Windows or MacOS arrived). -Today, printing in the console is used mostly as a monitoring tool, ideal to leave a trace of the content of variables during the program execution. +Today, printing in the console is mostly used as a monitoring tool, ideal for leaving a trace of the content of variables during program execution. This is an example of how to use it: @@ -22,4 +22,4 @@ console.log("How are you?"); ## 馃挕 Hint: -+ 5 minutes video about the console: https://www.youtube.com/watch?v=1RlkftxAo-M ++ 5 minute video about the console: https://www.youtube.com/watch?v=1RlkftxAo-M From 88e78805c0d3253710242fea438e966ae6eff213 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:50:57 +0200 Subject: [PATCH 02/93] Update README.md --- exercises/01-Hello_World/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/01-Hello_World/README.md b/exercises/01-Hello_World/README.md index 745bce59..fbf2ee47 100644 --- a/exercises/01-Hello_World/README.md +++ b/exercises/01-Hello_World/README.md @@ -18,7 +18,7 @@ console.log("How are you?"); ## 馃摑 Instructions: -1. Use console.log to print "Hello World" on the console. Feel free to try other things as well. +1. Use `console.log()` to print "Hello World" on the console. Feel free to try other things as well. ## 馃挕 Hint: From 01e8fda99ac3455f33e9e52ed4251191201cc324 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:51:49 +0200 Subject: [PATCH 03/93] Update README.es.md --- exercises/01-Hello_World/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/01-Hello_World/README.es.md b/exercises/01-Hello_World/README.es.md index 78cb77b2..efd99938 100644 --- a/exercises/01-Hello_World/README.es.md +++ b/exercises/01-Hello_World/README.es.md @@ -1,10 +1,10 @@ # `01` Hello World -En JavaScript, usamos `console.log` para hacer que la computadora escriba lo que queramos (el contenido de una variable, una cadena dada, etc.) en algo llamado `la consola`. +En JavaScript, usamos `console.log()` para hacer que la computadora escriba lo que queramos (el contenido de una variable, una cadena de caracteres, etc.) en algo llamado **la consola**. Cada lenguaje de programaci贸n tiene una consola, ya que era la 煤nica forma de interactuar con los usuarios al principio (antes de que llegaran Windows o MacOS). -Hoy, la impresi贸n en la consola se usa principalmente como una herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecuci贸n del programa. +Hoy en d铆a, imprimir en la consola se usa principalmente como una herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecuci贸n del programa. Este es un ejemplo de c贸mo usarlo: @@ -14,7 +14,7 @@ console.log("How are you?"); ## 馃摑 Instrucciones: -1. Usa `console.log` para imprimir "Hello World" en la consola. Si茅ntete libre de probar otras cosas tambi茅n. +1. Usa `console.log()` para imprimir "Hello World" en la consola. Si茅ntete libre de probar otras cosas tambi茅n. ## 馃挕 Pista: From ffdb1c80a499952c41509b075228b49b44bfda70 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:55:20 +0200 Subject: [PATCH 04/93] Update tests.js --- exercises/01-Hello_World/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/01-Hello_World/tests.js b/exercises/01-Hello_World/tests.js index 07254e41..db9312f2 100644 --- a/exercises/01-Hello_World/tests.js +++ b/exercises/01-Hello_World/tests.js @@ -11,7 +11,7 @@ let _log = console.log; // We make the text lower case to make it case insensitive global.console.log = console.log = jest.fn((text) => _buffer += text.toLowerCase() + "\n"); -test('console.log() function should be called with Hello World', function () { +test('console.log() function should be called with "Hello World"', function () { /* Here is how to mock the alert function: From 233aadb2ba0a6d89d233bd285f3ae0be5b3a5f9a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:23:22 +0200 Subject: [PATCH 05/93] Update README.md --- exercises/02.1-Access_and_retrieve/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/exercises/02.1-Access_and_retrieve/README.md b/exercises/02.1-Access_and_retrieve/README.md index 5453093a..b0a6fc43 100644 --- a/exercises/02.1-Access_and_retrieve/README.md +++ b/exercises/02.1-Access_and_retrieve/README.md @@ -11,13 +11,14 @@ For example, we could have an array that stores the days of the week: ```js let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']; ``` + Every array has the following parts: -- *Items*: are the actual values inside on each position of the array. +- **Items**: are the actual values inside each position of the array. -- *Length*: is the size of the array, the number of items. +- **Length**: is the size of the array, the number of items. -- *Index*: is the position of an element. +- **Index**: is the position of an element. ![How arrays work](../../.learn/assets/DbmSOHT.png?raw=true) @@ -25,9 +26,9 @@ To access any item within the array you need to know its index (position). The i **IMPORTANT: Every array starts from zero (0)!** -## 馃摑 Instructions +## 馃摑 Instructions: -1. Using the `console.log` function, print the 3rd item from the array. +1. Using the `console.log()` function, print the 3rd item from the array. 2. Change the value in the position where `thursday` is located to `null`. From 15691d1ea745402008fd32f4324d9ee8613f413f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:24:17 +0200 Subject: [PATCH 06/93] Update README.md --- exercises/02.1-Access_and_retrieve/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02.1-Access_and_retrieve/README.md b/exercises/02.1-Access_and_retrieve/README.md index b0a6fc43..35987bd1 100644 --- a/exercises/02.1-Access_and_retrieve/README.md +++ b/exercises/02.1-Access_and_retrieve/README.md @@ -18,7 +18,7 @@ Every array has the following parts: - **Length**: is the size of the array, the number of items. -- **Index**: is the position of an element. +- **Index**: is the position of an element (item). ![How arrays work](../../.learn/assets/DbmSOHT.png?raw=true) From 64b2ea79c09d151361d47cd0384534624ff9391a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:31:09 +0200 Subject: [PATCH 07/93] Update README.md --- exercises/02.1-Access_and_retrieve/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02.1-Access_and_retrieve/README.md b/exercises/02.1-Access_and_retrieve/README.md index 35987bd1..4c242063 100644 --- a/exercises/02.1-Access_and_retrieve/README.md +++ b/exercises/02.1-Access_and_retrieve/README.md @@ -4,7 +4,7 @@ tutorial: https://www.youtube.com/watch?v=9-yAzjsWXtU # `02.1` Access and Retrieve -Arrays are part of every programming language. They are the way to go when you want to have a "list of elements." +Arrays are part of every programming language. They are the way to go when you want to have a "list of elements". For example, we could have an array that stores the days of the week: From 8b18167371dcb10dfc171526ae27f8dd1b3d704e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:36:11 +0200 Subject: [PATCH 08/93] Update README.es.md --- .../02.1-Access_and_retrieve/README.es.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/02.1-Access_and_retrieve/README.es.md b/exercises/02.1-Access_and_retrieve/README.es.md index c8c4f102..54c716a7 100644 --- a/exercises/02.1-Access_and_retrieve/README.es.md +++ b/exercises/02.1-Access_and_retrieve/README.es.md @@ -10,26 +10,26 @@ let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','satu Cada array tiene las siguientes partes: -- *Item*s*: son los valores reales dentro de cada posici贸n del array (array). +- **Items** (Elementos): son los valores dentro de cada posici贸n del array. -- *Length* (Longitud): es el tama帽o del array, el n煤mero de elementos. +- **Length** (Longitud): es el tama帽o del array, el n煤mero de elementos. -- *Index* (indice): es la posici贸n de un elemento. +- **Index** (indice): es la posici贸n de un elemento. ![Como funciona un array](../../.learn/assets/DbmSOHT.png?raw=true) -Para acceder a cualquier elemento en particular dentro de un array (array) debes conocer su 铆ndice (posici贸n). El 铆ndice o index es un valor entero que representa la posici贸n en la que se encuentra el elemento. +Para acceder a cualquier elemento en particular dentro de un array debes conocer su 铆ndice (posici贸n). El 铆ndice o index es un valor entero que representa la posici贸n en la que se encuentra el elemento. -**!IMPORTANTE: 隆Cada array comienza desde cero (0)!** +**IMPORTANTE: 隆Cada array comienza desde cero (0)!** -## 馃摑 Instrucciones +## 馃摑 Instrucciones: -1. Usando la funci贸n `console.log`, imprime el tercer elemento del array. +1. Usando la funci贸n `console.log()`, imprime el tercer elemento del array. -2. Cambia el valor en la posici贸n donde se encuentra `jueves` a `null` (nulo). +2. Cambia el valor en la posici贸n donde se encuentra `thursday` a `null`. -3. Imprime esa posici贸n en particular. +3. Imprime esa posici贸n. ## 馃挕 Pista: - + Usa `null` como valor y no como un string. ++ Usa `null` como valor y no como un string. From 0f402f0fe1e321ded5bf769274e103f5e24116a3 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:36:52 +0200 Subject: [PATCH 09/93] Update README.es.md --- exercises/02.1-Access_and_retrieve/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02.1-Access_and_retrieve/README.es.md b/exercises/02.1-Access_and_retrieve/README.es.md index 54c716a7..bababe91 100644 --- a/exercises/02.1-Access_and_retrieve/README.es.md +++ b/exercises/02.1-Access_and_retrieve/README.es.md @@ -14,7 +14,7 @@ Cada array tiene las siguientes partes: - **Length** (Longitud): es el tama帽o del array, el n煤mero de elementos. -- **Index** (indice): es la posici贸n de un elemento. +- **Index** (脥ndice): es la posici贸n de un elemento. ![Como funciona un array](../../.learn/assets/DbmSOHT.png?raw=true) From 0e1dd6174d31c072b79c7757767a45b80f6612b4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:38:42 +0200 Subject: [PATCH 10/93] Update app.js --- exercises/02.1-Access_and_retrieve/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/02.1-Access_and_retrieve/app.js b/exercises/02.1-Access_and_retrieve/app.js index eec85929..43798cf4 100644 --- a/exercises/02.1-Access_and_retrieve/app.js +++ b/exercises/02.1-Access_and_retrieve/app.js @@ -1,8 +1,8 @@ -//declaring the array +// Declaring the array let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']; -//1. print the item here +// 1. print the item here -//2. change 'thursday'a value here to null +// 2. change the 'thursday' value to null here -//3. print the position of step 2 \ No newline at end of file +// 3. print the position of step 2 From d4533f5bc77cf77425e0cc4a700799ca9aba0f95 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:40:48 +0200 Subject: [PATCH 11/93] Update solution.hide.js --- exercises/02.1-Access_and_retrieve/solution.hide.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/02.1-Access_and_retrieve/solution.hide.js b/exercises/02.1-Access_and_retrieve/solution.hide.js index 84ad1a16..653f778d 100644 --- a/exercises/02.1-Access_and_retrieve/solution.hide.js +++ b/exercises/02.1-Access_and_retrieve/solution.hide.js @@ -1,14 +1,14 @@ -//declaring the array +// Declaring the array -//. 0. 1. 2. 3. 4. 5. 6 +//. 0 1 2 3 4 5 6 let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']; -//1. print the item here +// 1. print the 3rd item here console.log(myArray[2]) -//2. change 'thursday'a value here to null +// 2. change 'thursday' value to null here myArray[4] = null; -//3. print the position of step 2 -console.log(myArray[4]) \ No newline at end of file +// 3. print the position of step 2 +console.log(myArray[4]) From cd404b443b045d3b92aaf4981471020b7407238a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:41:04 +0200 Subject: [PATCH 12/93] Update app.js --- exercises/02.1-Access_and_retrieve/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02.1-Access_and_retrieve/app.js b/exercises/02.1-Access_and_retrieve/app.js index 43798cf4..70c752f1 100644 --- a/exercises/02.1-Access_and_retrieve/app.js +++ b/exercises/02.1-Access_and_retrieve/app.js @@ -1,7 +1,7 @@ // Declaring the array let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']; -// 1. print the item here +// 1. print the 3rd item here // 2. change the 'thursday' value to null here From 72bd744d0c0ca25031a5df1e2cfd766d48360959 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:43:36 +0200 Subject: [PATCH 13/93] Update tests.js --- exercises/02.1-Access_and_retrieve/tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/02.1-Access_and_retrieve/tests.js b/exercises/02.1-Access_and_retrieve/tests.js index 06805d52..3e59ad95 100644 --- a/exercises/02.1-Access_and_retrieve/tests.js +++ b/exercises/02.1-Access_and_retrieve/tests.js @@ -20,7 +20,7 @@ it('console.log() function should have been called 2 times', function () { expect(console.log.mock.calls.length).toBe(2); }); -it('Print the third item on the array (position 2)', function () { +it('Print the 3rd item of the array (position 2)', function () { //You can also compare the entire console buffer (if there have been several console.log calls on the exercise) expect(_buffer.includes("tuesday\n")).toBe(true); }); @@ -29,7 +29,7 @@ it('The fourth item in the array must be equal to "null"' , function(){ expect(myArray[4]).toBe(null) }) -it('Print the 4th position of the array', function () { +it('Print the 4th position of the array (item 5)', function () { //You can also compare the entire console buffer (if there have been several console.log calls on the exercise) expect(_buffer.includes("null\n")).toBe(true); -}); \ No newline at end of file +}); From 535e9a0aae589fa1425421f98da7a4258400c1f1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:45:14 +0200 Subject: [PATCH 14/93] Update solution.hide.js --- exercises/02.1-Access_and_retrieve/solution.hide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02.1-Access_and_retrieve/solution.hide.js b/exercises/02.1-Access_and_retrieve/solution.hide.js index 653f778d..82747bed 100644 --- a/exercises/02.1-Access_and_retrieve/solution.hide.js +++ b/exercises/02.1-Access_and_retrieve/solution.hide.js @@ -1,6 +1,6 @@ // Declaring the array -//. 0 1 2 3 4 5 6 +//. positions: 0 1 2 3 4 5 6 let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']; From 7a25f8df68957440e7d098855c5e1d916d3418c6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:45:40 +0200 Subject: [PATCH 15/93] Update solution.hide.js --- exercises/02.1-Access_and_retrieve/solution.hide.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/02.1-Access_and_retrieve/solution.hide.js b/exercises/02.1-Access_and_retrieve/solution.hide.js index 82747bed..064e0e51 100644 --- a/exercises/02.1-Access_and_retrieve/solution.hide.js +++ b/exercises/02.1-Access_and_retrieve/solution.hide.js @@ -5,10 +5,10 @@ let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','satu // 1. print the 3rd item here -console.log(myArray[2]) +console.log(myArray[2]); // 2. change 'thursday' value to null here myArray[4] = null; // 3. print the position of step 2 -console.log(myArray[4]) +console.log(myArray[4]); From c47bdbfad8a4397dc0f5a3f551b1ace696081e9f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:51:27 +0200 Subject: [PATCH 16/93] Update README.md --- exercises/02.2-Retrieve_Items/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/02.2-Retrieve_Items/README.md b/exercises/02.2-Retrieve_Items/README.md index d92c3ebd..31f733a2 100644 --- a/exercises/02.2-Retrieve_Items/README.md +++ b/exercises/02.2-Retrieve_Items/README.md @@ -4,7 +4,7 @@ tutorial: https://www.youtube.com/watch?v=rWYIgofIAME # `02.2` Retrieve Items -The only way to access a particular element in an array is by using an index. An **index** is an integer number that represents the position you want to access in the array. +The only way to access a particular element in an array is by using the index. The **index** is an integer number that represents the position you want to access in the array. You need to wrap the index into brackets like this: @@ -14,6 +14,6 @@ let myValue = array[index]; ## 馃摑 Instructions: -1. Print on the console the 1st element of the array +1. Print on the console the 1st element of the array. -2. Print on the console the 4th element of the array +2. Print on the console the 4th element of the array. From 68210bcd3d653c8b0fe1f730ee95ffeadf6b61a4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:53:04 +0200 Subject: [PATCH 17/93] Update README.es.md --- exercises/02.2-Retrieve_Items/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/02.2-Retrieve_Items/README.es.md b/exercises/02.2-Retrieve_Items/README.es.md index d5980863..8a1eca4b 100644 --- a/exercises/02.2-Retrieve_Items/README.es.md +++ b/exercises/02.2-Retrieve_Items/README.es.md @@ -1,6 +1,6 @@ # `02.2` Retrieve Items -La 煤nica forma de acceder a un elemento particular en un arreglo es usando un 铆ndice. Un **铆ndice (index)** es un n煤mero entero que representa la posici贸n a la que desea acceder en el arreglo. +La 煤nica forma de acceder a un elemento particular en un arreglo es usando el 铆ndice. El **铆ndice (index)** es un n煤mero entero que representa la posici贸n a la que desea acceder en el arreglo. Debes envolver el 铆ndice entre corchetes de esta manera: @@ -8,8 +8,8 @@ Debes envolver el 铆ndice entre corchetes de esta manera: let myValue = array[index]; ``` -## 馃摑 Instrucciones +## 馃摑 Instrucciones: -1. Imprima en la consola el 1er elemento de array o arreglo. +1. Imprima en la consola el 1er elemento del array. -2. Imprima en la consola el 4to elemento de la arreglo o array. \ No newline at end of file +2. Imprima en la consola el 4to elemento del array. From be8ca2705ba5b6d17644fd098d077e8ab71fafc1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:53:33 +0200 Subject: [PATCH 18/93] Update app.js --- exercises/02.2-Retrieve_Items/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/02.2-Retrieve_Items/app.js b/exercises/02.2-Retrieve_Items/app.js index de6a1d49..00055b71 100644 --- a/exercises/02.2-Retrieve_Items/app.js +++ b/exercises/02.2-Retrieve_Items/app.js @@ -1,3 +1,3 @@ let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23]; -//your code here \ No newline at end of file +// your code here From 0892b6b8cb9cb95e5b889002fb9997a506bf669b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:55:01 +0200 Subject: [PATCH 19/93] Update solution.hide.js --- exercises/02.2-Retrieve_Items/solution.hide.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/exercises/02.2-Retrieve_Items/solution.hide.js b/exercises/02.2-Retrieve_Items/solution.hide.js index 01e6a002..d87f9889 100644 --- a/exercises/02.2-Retrieve_Items/solution.hide.js +++ b/exercises/02.2-Retrieve_Items/solution.hide.js @@ -1,11 +1,8 @@ -// 0.1. 2. 3. 4. 5. 6.7. 8. 9. 10..... +// 0.1. 2. 3. 4. 5. 6. 7. 8. 9. 10..... let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23]; -//your code here - -let aux = arr[0]; +// your code here console.log(arr[0]); - -console.log(arr[3]); \ No newline at end of file +console.log(arr[3]); From 5a45ca6f52d64c67a522c04c6c98fa9fdfd9f46a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 12:57:25 +0200 Subject: [PATCH 20/93] Update tests.js --- exercises/02.2-Retrieve_Items/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/02.2-Retrieve_Items/tests.js b/exercises/02.2-Retrieve_Items/tests.js index a41ab3b8..9a63ebe7 100644 --- a/exercises/02.2-Retrieve_Items/tests.js +++ b/exercises/02.2-Retrieve_Items/tests.js @@ -17,7 +17,7 @@ it('console.log() function should have been called 2 times', function () { expect(console.log.mock.calls.length).toBe(2); }); -it('Print the 1st item on the array (position 2)', function () { +it('Print the 1st item of the array (position 0)', function () { //You can also compare the entire console buffer (if there have been several console.log calls on the exercise) expect(_buffer.includes("4\n")).toBe(true); }); @@ -25,4 +25,4 @@ it('Print the 1st item on the array (position 2)', function () { it('Print the 4th item of the array', function () { //You can also compare the entire console buffer (if there have been several console.log calls on the exercise) expect(_buffer.includes("43\n")).toBe(true); -}); \ No newline at end of file +}); From cda068ebbf185f32596cf257533ed81fcee921b2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:08:08 +0200 Subject: [PATCH 21/93] Update README.md --- exercises/03-Print_the_last_one/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/03-Print_the_last_one/README.md b/exercises/03-Print_the_last_one/README.md index d3cc20e5..9994eaa5 100644 --- a/exercises/03-Print_the_last_one/README.md +++ b/exercises/03-Print_the_last_one/README.md @@ -6,14 +6,14 @@ tutorial: https://www.youtube.com/watch?v=d-CnlwX6x1A You will never know how many items `myStupidArray` has because it is being randomly generated during runtime using the `generateRandomArray` function. -But don't worry! The property `myStupidArray.length` returns the length of `myArray` (try console logging it and you will see the length displayed on the console). +But don't worry! The property `myStupidArray.length` returns the length of `myStupidArray` (try console logging it, and you will see the length displayed on the console). ```js let totalItems = myStupidArray.length; ``` -## 馃摑 Instructions +## 馃摑 Instructions: -1. Create a variable named `theLastOne`, and assign it the LAST element of `myStupidArray`. +1. Create a variable named `theLastOne`, and assign to it the LAST element of `myStupidArray`. 2. Then, print it on the console. From 04b1eb7f01a639b146d52579344726f9d3534bdf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:10:48 +0200 Subject: [PATCH 22/93] Update README.es.md --- exercises/03-Print_the_last_one/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/03-Print_the_last_one/README.es.md b/exercises/03-Print_the_last_one/README.es.md index 466942f0..23749d72 100644 --- a/exercises/03-Print_the_last_one/README.es.md +++ b/exercises/03-Print_the_last_one/README.es.md @@ -2,7 +2,7 @@ Nunca sabr谩s cu谩ntos elementos tiene `myStupidArray` porque se genera aleatoriamente durante el tiempo de ejecuci贸n utilizando la funci贸n `generateRandomArray`. -隆Pero no te preocupes! La propiedad `myStupidArray.length` devuelve la longitud de `myArray` (intenta hacer un `console.log` y ver谩s la longitud que se muestra en la consola). +隆Pero no te preocupes! La propiedad `myStupidArray.length` devuelve la longitud de `myStupidArray` (intenta hacer un `console.log()` y ver谩s la longitud que se muestra en la consola). ```js let totalItems = myStupidArray.length; @@ -12,4 +12,4 @@ let totalItems = myStupidArray.length; 1. Crea una variable llamada `theLastOne` y as铆gnale el 煤ltimo elemento de `myStupidArray`. -2. Luego, impr铆melo en la consola. \ No newline at end of file +2. Luego, impr铆melo en la consola. From 43a99e2dd7fe55d19f0dc4306b609c2c15423461 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:12:03 +0200 Subject: [PATCH 23/93] Update app.js --- exercises/03-Print_the_last_one/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/03-Print_the_last_one/app.js b/exercises/03-Print_the_last_one/app.js index cc912fbf..e4dc515a 100644 --- a/exercises/03-Print_the_last_one/app.js +++ b/exercises/03-Print_the_last_one/app.js @@ -7,4 +7,4 @@ function generateRandomArray() } let myStupidArray = generateRandomArray(); -//Your code here +// Your code here From 44abb42d3239f9591fb97cbbeeddcff35a25de83 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:12:40 +0200 Subject: [PATCH 24/93] Update solution.hide.js --- exercises/03-Print_the_last_one/solution.hide.js | 1 - 1 file changed, 1 deletion(-) diff --git a/exercises/03-Print_the_last_one/solution.hide.js b/exercises/03-Print_the_last_one/solution.hide.js index f2aa799c..abe5569a 100644 --- a/exercises/03-Print_the_last_one/solution.hide.js +++ b/exercises/03-Print_the_last_one/solution.hide.js @@ -7,7 +7,6 @@ function generateRandomArray() } let myStupidArray = generateRandomArray(); -// 0. 1. 2 let theLastOne = myStupidArray[myStupidArray.length - 1]; console.log(theLastOne) From 8bb30a11a4bbeb47ffbf26c53b5d5fd680bc693d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:12:55 +0200 Subject: [PATCH 25/93] Update solution.hide.js --- exercises/03-Print_the_last_one/solution.hide.js | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/03-Print_the_last_one/solution.hide.js b/exercises/03-Print_the_last_one/solution.hide.js index abe5569a..61d6df97 100644 --- a/exercises/03-Print_the_last_one/solution.hide.js +++ b/exercises/03-Print_the_last_one/solution.hide.js @@ -7,6 +7,7 @@ function generateRandomArray() } let myStupidArray = generateRandomArray(); +// Your code here let theLastOne = myStupidArray[myStupidArray.length - 1]; console.log(theLastOne) From 352453e53747ff8c6191b3d19701205a9c2960c0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:13:19 +0200 Subject: [PATCH 26/93] Update solution.hide.js --- exercises/03-Print_the_last_one/solution.hide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/03-Print_the_last_one/solution.hide.js b/exercises/03-Print_the_last_one/solution.hide.js index 61d6df97..401d84f9 100644 --- a/exercises/03-Print_the_last_one/solution.hide.js +++ b/exercises/03-Print_the_last_one/solution.hide.js @@ -2,7 +2,7 @@ function generateRandomArray() { let auxArray = []; let randomLength = Math.floor(Math.random()*100); - for(let i = 0;i Date: Wed, 6 Sep 2023 13:13:26 +0200 Subject: [PATCH 27/93] Update solution.hide.js --- exercises/03-Print_the_last_one/solution.hide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/03-Print_the_last_one/solution.hide.js b/exercises/03-Print_the_last_one/solution.hide.js index 401d84f9..8ffa4d85 100644 --- a/exercises/03-Print_the_last_one/solution.hide.js +++ b/exercises/03-Print_the_last_one/solution.hide.js @@ -2,7 +2,7 @@ function generateRandomArray() { let auxArray = []; let randomLength = Math.floor(Math.random()*100); - for(let i = 0; i < randomLength;i++) auxArray.push(Math.floor(Math.random()*100)); + for(let i = 0; i < randomLength; i++) auxArray.push(Math.floor(Math.random()*100)); return auxArray; } let myStupidArray = generateRandomArray(); From 22cd0caa4c49dacbb622723186436e465fddb852 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:25:20 +0200 Subject: [PATCH 28/93] Update README.md --- exercises/04.1-Loop_from_one_to_seventeen/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/README.md b/exercises/04.1-Loop_from_one_to_seventeen/README.md index ddeb0dc6..a83efee4 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/README.md +++ b/exercises/04.1-Loop_from_one_to_seventeen/README.md @@ -4,13 +4,13 @@ tutorial: https://www.youtube.com/watch?v=4QGaROXZ3oc # `04.1` Loop from one to seventeen -The current loop is looping from zero to ten, +The current loop is looping from zero to ten. -## 馃摑 Instructions +## 馃摑 Instructions: 1. Please make it loop from 1 to 17. -## Example output: +## 馃捇 Example output: ```js 1 @@ -36,4 +36,4 @@ The current loop is looping from zero to ten, + You have to loop from 1 to 17 (not from 0 to 17). -+ Here is a [2 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ). \ No newline at end of file ++ Here is a [6 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ). From 02f0fc631303328aee9099f631988a2adf52a10a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:35:02 +0200 Subject: [PATCH 29/93] Update README.es.md --- exercises/04.1-Loop_from_one_to_seventeen/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/README.es.md b/exercises/04.1-Loop_from_one_to_seventeen/README.es.md index a436dc13..196d3d2e 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/README.es.md +++ b/exercises/04.1-Loop_from_one_to_seventeen/README.es.md @@ -1,12 +1,12 @@ # `04.1` Loop from one to seventeen -El loop (bucle) actual se repite del cero a diez, +El loop (bucle) actual se repite del cero a diez. ## 馃摑 Instrucciones: 1. Por favor, haz un loop de 1 a 17. -## Ejemplo de salida: +## 馃捇 Ejemplo de salida: ```js 1 @@ -28,8 +28,8 @@ El loop (bucle) actual se repite del cero a diez, 17 ``` -## 馃挕 Pista: +## 馃挕 Pistas: + Tienes que recorrer del 1 al 17 (no del 0 al 17). -+ Aqu铆 esta un [video de 2 min explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ). ++ Aqu铆 est谩 un [video de 6 minutos explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ). From 5b95fd9223a3e38f8e359670f982d136af94e357 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:35:37 +0200 Subject: [PATCH 30/93] Update app.js --- exercises/04.1-Loop_from_one_to_seventeen/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/app.js b/exercises/04.1-Loop_from_one_to_seventeen/app.js index 308cd4cc..93febcd9 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/app.js +++ b/exercises/04.1-Loop_from_one_to_seventeen/app.js @@ -1,4 +1,4 @@ -//change the conditions of the for loop -for(let number = 0; number < 10; number++){ - //print the number +// change the conditions of the for loop +for(let number = 0; number < 10; number++) { + // print the number } From d03dec7a6c89b40ee219bbfe1cfc6ad2b31e1087 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:36:30 +0200 Subject: [PATCH 31/93] Update solution.hide.js --- .../solution.hide.js | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js b/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js index 188dd537..58753113 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js +++ b/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js @@ -1,24 +1,5 @@ -//you code here - -// PREVIOUS SOLUTION.HIDE.JS - -// for(let i = 1; i <= 17; i = i + 1){ -// console.log(i) -// } - -// let listOfHellos = new Array(17).fill("hello"); -// for(let pos in listOfHellos){ -// console.log(parseInt(pos)+1) -// } -// console.log("Third approach") -// listOfHellos.forEach((item, index) => { -// console.log(parseInt(index)+1) -// }) - -// MY SOLUTION.HIDE.JS - -//change the conditions of the for loop -for(let number = 1; number <= 17; number++){ - //print the number +// change the conditions of the for loop +for(let number = 1; number <= 17; number++) { + // print the number console.log(number) } From ce21114876f4502e0bc71543c251d65fbabe24f9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:37:31 +0200 Subject: [PATCH 32/93] Update tests.js --- exercises/04.1-Loop_from_one_to_seventeen/tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/tests.js b/exercises/04.1-Loop_from_one_to_seventeen/tests.js index 17aea42e..b8af0348 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/tests.js +++ b/exercises/04.1-Loop_from_one_to_seventeen/tests.js @@ -6,7 +6,7 @@ let _log = console.log; let _buffer = ''; global.console.log = console.log = jest.fn((text) => _buffer += text + "\n"); -it('Call the console.log function on every cicle', function () { +it('Call the console.log function on every cycle', function () { const app = require('./app.js'); expect(console.log.mock.calls.length).toBe(17); }); @@ -16,6 +16,6 @@ test('You have to use a for loop', () => { expect(regex.test(file.toString())).toBeTruthy(); }) -it('Print the numbers on the console on each loop cicle (inside the loop)', function () { +it('Print the numbers on the console on each loop cycle (inside the loop)', function () { expect(_buffer).toMatch("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n"); -}); \ No newline at end of file +}); From c45ccd67d4766e1c5cd57f27a3de40f36f3afe78 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:38:04 +0200 Subject: [PATCH 33/93] Update app.js --- exercises/04.1-Loop_from_one_to_seventeen/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/app.js b/exercises/04.1-Loop_from_one_to_seventeen/app.js index 93febcd9..11c47dca 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/app.js +++ b/exercises/04.1-Loop_from_one_to_seventeen/app.js @@ -1,4 +1,4 @@ -// change the conditions of the for loop +// Change the conditions of the for loop for(let number = 0; number < 10; number++) { - // print the number + // Print the number } From fe245e7e953b0e1872f5cbb4993e61040f0ab1a0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:38:21 +0200 Subject: [PATCH 34/93] Update solution.hide.js --- exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js b/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js index 58753113..69fbbaf6 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js +++ b/exercises/04.1-Loop_from_one_to_seventeen/solution.hide.js @@ -1,5 +1,5 @@ -// change the conditions of the for loop +// Change the conditions of the for loop for(let number = 1; number <= 17; number++) { - // print the number + // Print the number console.log(number) } From ac77e1e749a0d68adb5c89ceac6fe14cf6d344b7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:43:25 +0200 Subject: [PATCH 35/93] Update README.md --- exercises/04.2-Loop_from_seven_to_twelve/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/04.2-Loop_from_seven_to_twelve/README.md b/exercises/04.2-Loop_from_seven_to_twelve/README.md index de575b13..824ae907 100644 --- a/exercises/04.2-Loop_from_seven_to_twelve/README.md +++ b/exercises/04.2-Loop_from_seven_to_twelve/README.md @@ -8,7 +8,7 @@ tutorial: https://www.youtube.com/watch?v=6eLXV_IL2m0 1. Count from 7 to 12 with a loop and print each number on the console. -## Example output: +## 馃捇 Example output: ```js 7 @@ -21,5 +21,5 @@ tutorial: https://www.youtube.com/watch?v=6eLXV_IL2m0 ## 馃挕 Hint: -You have to loop from 7 to 12 (including 12). ++ You have to loop from 7 to 12 (including 12). From 14a0fd756cb7289167d048f0b3936b0bb816db98 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:45:31 +0200 Subject: [PATCH 36/93] Update README.es.md --- exercises/04.2-Loop_from_seven_to_twelve/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/04.2-Loop_from_seven_to_twelve/README.es.md b/exercises/04.2-Loop_from_seven_to_twelve/README.es.md index 7892d7d8..80ada9c7 100644 --- a/exercises/04.2-Loop_from_seven_to_twelve/README.es.md +++ b/exercises/04.2-Loop_from_seven_to_twelve/README.es.md @@ -4,7 +4,7 @@ 1. Cuenta del 7 al 12 con un loop e imprime cada n煤mero en la consola. -## Ejemplo de salida: +## 馃捇 Ejemplo de salida: ```js 7 @@ -17,4 +17,4 @@ ## 馃挕 Pista: -+ Tienes que recorrer de 7 a 12 (incluyendo 12). \ No newline at end of file ++ Tienes que recorrer del 7 a 12 (incluyendo 12). From 27c79e31c965408799d2b2986f27aeee78fb8847 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:45:42 +0200 Subject: [PATCH 37/93] Update app.js --- exercises/04.2-Loop_from_seven_to_twelve/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.2-Loop_from_seven_to_twelve/app.js b/exercises/04.2-Loop_from_seven_to_twelve/app.js index 8772f7b9..877a3aa0 100644 --- a/exercises/04.2-Loop_from_seven_to_twelve/app.js +++ b/exercises/04.2-Loop_from_seven_to_twelve/app.js @@ -1 +1 @@ -//you code here \ No newline at end of file +// Your code here From 852cb69411464a1960254c1831b53c530cc873d5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:46:09 +0200 Subject: [PATCH 38/93] Update solution.hide.js --- exercises/04.2-Loop_from_seven_to_twelve/solution.hide.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/04.2-Loop_from_seven_to_twelve/solution.hide.js b/exercises/04.2-Loop_from_seven_to_twelve/solution.hide.js index 60f70f03..0ea14ad6 100644 --- a/exercises/04.2-Loop_from_seven_to_twelve/solution.hide.js +++ b/exercises/04.2-Loop_from_seven_to_twelve/solution.hide.js @@ -1,4 +1,4 @@ -//you code here -for(let i = 7; i <= 12; i++){ +// Your code here +for(let i = 7; i <= 12; i++) { console.log(i) -} \ No newline at end of file +} From f8f400b22ee28078ceef39a2c28f10051e97f12c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:47:48 +0200 Subject: [PATCH 39/93] Update tests.js --- exercises/04.2-Loop_from_seven_to_twelve/tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/04.2-Loop_from_seven_to_twelve/tests.js b/exercises/04.2-Loop_from_seven_to_twelve/tests.js index 90ced602..8e61b972 100644 --- a/exercises/04.2-Loop_from_seven_to_twelve/tests.js +++ b/exercises/04.2-Loop_from_seven_to_twelve/tests.js @@ -6,7 +6,7 @@ let _log = console.log; let _buffer = ''; global.console.log = console.log = jest.fn((text) => _buffer += text + "\n"); -it('Call the console.log function just one time', function () { +it('Call the console.log function on every cycle', function () { const app = require('./app.js'); expect(console.log.mock.calls.length).toBe(6); }); @@ -17,6 +17,6 @@ test('You have to use a for loop', () => { expect(regex.test(file.toString())).toBeTruthy(); }) -it('Print the numbers on the console on each loop cicly (inside the loop)', function () { +it('Print the numbers on the console on each loop cycle (inside the loop)', function () { expect(_buffer).toMatch("7\n8\n9\n10\n11\n12\n"); -}); \ No newline at end of file +}); From 9c1b2e92a243a98f1b643819f467d8db940fdc54 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:57:50 +0200 Subject: [PATCH 40/93] Update README.md --- exercises/04.3-Add_items_to_array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.3-Add_items_to_array/README.md b/exercises/04.3-Add_items_to_array/README.md index bf833e8e..eddab265 100644 --- a/exercises/04.3-Add_items_to_array/README.md +++ b/exercises/04.3-Add_items_to_array/README.md @@ -12,4 +12,4 @@ tutorial: https://www.youtube.com/watch?v=no9mCu-tvaM + You can use the `Math.random()` and `Math.floor()` functions to get random numbers. -+ You have to use the `.push(item)` function to add the new random number to the array. ++ You have to use the `.push()` function to add the new random number to the array. From 8f70f44792084f9c9a187b60fff9d33a94207191 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:03:19 +0200 Subject: [PATCH 41/93] Update README.es.md --- exercises/04.3-Add_items_to_array/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.3-Add_items_to_array/README.es.md b/exercises/04.3-Add_items_to_array/README.es.md index 7d878cfb..39467fb6 100644 --- a/exercises/04.3-Add_items_to_array/README.es.md +++ b/exercises/04.3-Add_items_to_array/README.es.md @@ -8,4 +8,4 @@ + Puedes usar las funciones `Math.random()` y `Math.floor()` para obtener n煤meros aleatorios. -+ Debes usar la funci贸n `.push (item)` para agregar el nuevo n煤mero aleatorio al array \ No newline at end of file ++ Debes usar la funci贸n `.push()` para agregar los n煤meros aleatorios al array. From 18c12b1a4bf87a654a0c5848c1d579e343d798b0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:03:50 +0200 Subject: [PATCH 42/93] Update README.md --- exercises/04.3-Add_items_to_array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.3-Add_items_to_array/README.md b/exercises/04.3-Add_items_to_array/README.md index eddab265..44576d59 100644 --- a/exercises/04.3-Add_items_to_array/README.md +++ b/exercises/04.3-Add_items_to_array/README.md @@ -12,4 +12,4 @@ tutorial: https://www.youtube.com/watch?v=no9mCu-tvaM + You can use the `Math.random()` and `Math.floor()` functions to get random numbers. -+ You have to use the `.push()` function to add the new random number to the array. ++ You have to use the `.push()` function to add the new random numbers to the array. From 2688169fa11bd33ee62a91cc2a706eda816b41cb Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:06:07 +0200 Subject: [PATCH 43/93] Update app.js --- exercises/04.3-Add_items_to_array/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/04.3-Add_items_to_array/app.js b/exercises/04.3-Add_items_to_array/app.js index 69a54ece..5e894127 100644 --- a/exercises/04.3-Add_items_to_array/app.js +++ b/exercises/04.3-Add_items_to_array/app.js @@ -1,5 +1,5 @@ let arr = [4,5,734,43,45]; -// Your code here, use the push function and the random function. +// Your code here, use the push() function and the 2 Math functions -console.log(arr); \ No newline at end of file +console.log(arr); From 46a0ddcb662000ac47ecc50893a4e48e677fbb91 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:08:19 +0200 Subject: [PATCH 44/93] Update tests.js --- exercises/04.3-Add_items_to_array/tests.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/04.3-Add_items_to_array/tests.js b/exercises/04.3-Add_items_to_array/tests.js index 32d88747..00ead37a 100644 --- a/exercises/04.3-Add_items_to_array/tests.js +++ b/exercises/04.3-Add_items_to_array/tests.js @@ -9,18 +9,18 @@ global.console.log = console.log = jest.fn((text) => _buffer += text + "\n"); const file = rewire("./app.js"); const arr = file.__get__("arr"); -it('Call the console.log function just one time', function () { +it('Call the console.log function only one time', function () { const app = require('./app.js'); expect(console.log.mock.calls.length).toBe(1); }); -it('Use the Math.floor function for whole numbers.(NO DECIMALS)', () => { +it('Use the Math.floor function for whole numbers (NO DECIMALS)', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /Math\s*\.\s*floor/gm expect(regex.test(file.toString())).toBeTruthy(); }) -it('The array arr should have 7 items', function () { +it('The array "arr" should have 7 items', function () { const app = rewire('./app.js'); const variable = app.__get__('arr'); expect(variable).toBeTruthy(); @@ -38,4 +38,4 @@ it('Make sure the last two items you added are numbers', function () { const variable = app.__get__('arr'); expect(isNumeric(variable[6])).toBeTruthy(); expect(isNumeric(variable[5])).toBeTruthy(); -}); \ No newline at end of file +}); From c7ff5c305b3682811f73b00168c675339f776f7b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:20:34 +0200 Subject: [PATCH 45/93] Update README.md --- exercises/04.4-Add_items_to_array_looping/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.4-Add_items_to_array_looping/README.md b/exercises/04.4-Add_items_to_array_looping/README.md index 081cbfe9..5fc203e9 100644 --- a/exercises/04.4-Add_items_to_array_looping/README.md +++ b/exercises/04.4-Add_items_to_array_looping/README.md @@ -16,4 +16,4 @@ tutorial: https://www.youtube.com/watch?v=QLnkSPNTgNo + You can use the `Math.random()` and `Math.floor()` functions to get random numbers, you should do that inside the loop. -+ On each loop iteration you have to use the `.push(item)` function to add the new random number to the array. ++ On each loop iteration you have to use the `.push()` function to add the new random number to the array. From 679f48101da198d255029d78ac9c7a873af94ae6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:21:58 +0200 Subject: [PATCH 46/93] Update README.es.md --- exercises/04.4-Add_items_to_array_looping/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/04.4-Add_items_to_array_looping/README.es.md b/exercises/04.4-Add_items_to_array_looping/README.es.md index 0d786e24..b01367d7 100644 --- a/exercises/04.4-Add_items_to_array_looping/README.es.md +++ b/exercises/04.4-Add_items_to_array_looping/README.es.md @@ -2,7 +2,7 @@ ## 馃摑 Instrucciones: -1. Agrega 10 n煤meros enteros aleatorios a la lista `arr` e imprime el array o arreglo en la consola. +1. Agrega 10 n煤meros enteros aleatorios a la lista `arr` e imprime el array en la consola. ## 馃挕 Pistas: @@ -12,4 +12,4 @@ + Puedes usar las funciones `Math.random()` y `Math.floor()` para obtener n煤meros aleatorios, debes hacerlo dentro del loop. -+ En cada iteraci贸n del loop, debes usar la funci贸n `.push (item)` para agregar el nuevo n煤mero aleatorio al array. ++ En cada iteraci贸n del loop debes usar la funci贸n `.push()` para agregar el nuevo n煤mero aleatorio al array. From a8898b53b1b8eba3499012cab43c037affafee2a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:23:29 +0200 Subject: [PATCH 47/93] Update solution.hide.js --- exercises/04.4-Add_items_to_array_looping/solution.hide.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exercises/04.4-Add_items_to_array_looping/solution.hide.js b/exercises/04.4-Add_items_to_array_looping/solution.hide.js index dd433b01..38b7d1e2 100644 --- a/exercises/04.4-Add_items_to_array_looping/solution.hide.js +++ b/exercises/04.4-Add_items_to_array_looping/solution.hide.js @@ -3,12 +3,10 @@ let arr = [4,5,734,43,45]; //***************** // Your code here // you need to loop 10 times, for example, using a for loop -// for(let i = 0; i<10;i++){ -// your loop content here -// } //***************** -for(let i = 0; i<10; i++){ +for(let i = 0; i < 10; i++) { arr.push(Math.floor(Math.random() * 100)); } + console.log(arr); From 1bef426a1f66d31898d4b4ab6b2f8ccfe3736731 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:30:32 +0200 Subject: [PATCH 48/93] Removed test that did the same as last one (line 26) to avoid confusion --- exercises/04.4-Add_items_to_array_looping/tests.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/exercises/04.4-Add_items_to_array_looping/tests.js b/exercises/04.4-Add_items_to_array_looping/tests.js index a8cd7037..e7433abd 100644 --- a/exercises/04.4-Add_items_to_array_looping/tests.js +++ b/exercises/04.4-Add_items_to_array_looping/tests.js @@ -6,15 +6,11 @@ let _log = console.log; let _buffer = ''; global.console.log = console.log = jest.fn((text) => _buffer += text + "\n"); -it('Call the console.log function just one time', function () { +it('Call the console.log function only one time', function () { const app = require('./app.js'); expect(console.log.mock.calls.length).toBe(1); }); -it('Print the array with 15 digits on the console', function () { - expect(_buffer).toMatch(/\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+,\d+/); -}); - it('You have to use Math.random() function', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /Math\s*\.\s*random/gm @@ -27,9 +23,9 @@ it('You have to use Math.floor() function', () => { expect(regex.test(file.toString())).toBeTruthy(); }) -test('The array arr should have 15 items', function () { +test('The array "arr" should have 15 items', function () { const app = rewire('./app.js'); const variable = app.__get__('arr'); expect(variable).toBeTruthy(); expect(variable.length).toBe(15); -}); \ No newline at end of file +}); From a6e70b09910a092a5bb149d5bc2b71a5fab96eac Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:43:17 +0200 Subject: [PATCH 49/93] Update README.md --- exercises/05.1-Loop_Array/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/05.1-Loop_Array/README.md b/exercises/05.1-Loop_Array/README.md index af1a65e1..77155a0f 100644 --- a/exercises/05.1-Loop_Array/README.md +++ b/exercises/05.1-Loop_Array/README.md @@ -4,7 +4,7 @@ tutorial: https://www.youtube.com/watch?v=Dd2uXOwhTzY # `05.1` Loop an array -In this exercise you will be looping an array from scratch. If you need a refresher, please take 6 minutes to watch this video on [how to loop an array](https://www.youtube.com/watch?v=24Wpg6njlYI). +In this exercise, you will be looping an array from scratch. ## 馃摑 Instructions: @@ -16,6 +16,6 @@ Instead of doing that: ## 馃挕 Hints: -+ Remember that to access the value of a position you have to use the index `(myArray[index])`. ++ Remember that to access the value of a position you have to use the index `myArray[index]`. -+ [Here is a cool video](https://www.youtube.com/watch?v=24Wpg6njlYI) explaining how to use the `for` loop to loop arrays. ++ [Here is a cool video](https://www.youtube.com/watch?v=24Wpg6njlYI) explaining how to use the *for loop* to loop arrays. From 1cd7686cd06b942a8d6a115b2d384b3a171551f3 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:47:13 +0200 Subject: [PATCH 50/93] Update README.md --- exercises/05.1-Loop_Array/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/exercises/05.1-Loop_Array/README.md b/exercises/05.1-Loop_Array/README.md index 77155a0f..161f511f 100644 --- a/exercises/05.1-Loop_Array/README.md +++ b/exercises/05.1-Loop_Array/README.md @@ -10,12 +10,10 @@ In this exercise, you will be looping an array from scratch. The code right now is printing the first item in the console. -Instead of doing that: - -1. Print all the elements in the array. Iterate through the whole array using a loop. +1. Instead of doing that, print all the elements in the array. Iterate through the whole array using a loop. ## 馃挕 Hints: -+ Remember that to access the value of a position you have to use the index `myArray[index]`. ++ Remember that to access the value of a position, you have to use the index `myArray[index]`. + [Here is a cool video](https://www.youtube.com/watch?v=24Wpg6njlYI) explaining how to use the *for loop* to loop arrays. From b4a87bf5312edfb153eb1354e47b6d77680c8418 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:47:24 +0200 Subject: [PATCH 51/93] Update README.es.md --- exercises/05.1-Loop_Array/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/05.1-Loop_Array/README.es.md b/exercises/05.1-Loop_Array/README.es.md index 3aee2d60..8c3c5df8 100644 --- a/exercises/05.1-Loop_Array/README.es.md +++ b/exercises/05.1-Loop_Array/README.es.md @@ -1,15 +1,15 @@ # `05.1` Loop an array -Ok, esta es la primera vez que vas a recorrer un loop o bucle desde cero, t贸mate 6 minutos para ver este video sobre [c贸mo recorrer un arreglo](https://www.youtube.com/watch?v=24Wpg6njlYI). +Ok, esta es la primera vez que vas a recorrer un loop o bucle desde cero. ## 馃摑 Instrucciones: -El c贸digo ahora imprime el primer elemento en la consola. +Ahora mismo el c贸digo imprime el primer elemento en la consola. -1. En vez de ello, imprime todos los elementos en el arreglo o array. Tendr谩s que recorrer todo el arreglo utilizando un loop. +1. En vez de ello, imprime todos los elementos del arreglo o array. Tendr谩s que recorrer todo el array utilizando un loop. ## 馃挕 Pistas: -+ Recuerda que para acceder al valor de una posici贸n debe usar el 铆ndice `(myArray [index])`. ++ Recuerda que para acceder al valor de una posici贸n debe usar el 铆ndice o index `myArray[index]`. -+ [Aqu铆 tienes un video genial](https://www.youtube.com/watch?v=24Wpg6njlYI) que explica c贸mo usar el bucle `for` para recorrer el loop de un arreglo o array. \ No newline at end of file ++ [Aqu铆 tienes un video genial](https://www.youtube.com/watch?v=24Wpg6njlYI) que explica c贸mo usar el bucle *for* para recorrer un array. From 7e8a130bfa961346042fa78e40d1e4545dd1a44d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:47:48 +0200 Subject: [PATCH 52/93] Update app.js --- exercises/05.1-Loop_Array/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/05.1-Loop_Array/app.js b/exercises/05.1-Loop_Array/app.js index 04f18c52..f5f8921f 100644 --- a/exercises/05.1-Loop_Array/app.js +++ b/exercises/05.1-Loop_Array/app.js @@ -1,4 +1,4 @@ let myArray = [232,32,1,4,55,4,3,32,3,24,5,5,5,34,2,3,5,5365743,52,34,3,55,33,435,4,6,54,63,45,4,67,56,47,1,34,54,32,54,1,78,98,0,9,8,98,76,7,54,2,3,42,456,4,3321,5]; -// wrap this console.log withing a loop and replace 0 with i -console.log(myArray[0]); \ No newline at end of file +// Wrap this console.log withing a loop and replace 0 with i +console.log(myArray[0]); From f572b6974ff4acc5433ec93af2c8d9f4baaa30bf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:48:08 +0200 Subject: [PATCH 53/93] Update solution.hide.js --- exercises/05.1-Loop_Array/solution.hide.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/05.1-Loop_Array/solution.hide.js b/exercises/05.1-Loop_Array/solution.hide.js index 5a3d01f5..4f297821 100644 --- a/exercises/05.1-Loop_Array/solution.hide.js +++ b/exercises/05.1-Loop_Array/solution.hide.js @@ -1,8 +1,6 @@ - -// 0. 1. 2.3 4 5 6 7 let myArray = [232,32,1,4,55,4,3,32,3,24,5,5,5,34,2,3,5,5365743,52,34,3,55,33,435,4,6,54,63,45,4,67,56,47,1,34,54,32,54,1,78,98,0,9,8,98,76,7,54,2,3,42,456,4,3321,5]; -// wrap this console.log withing a loop and replace 0 with i -for(let i = 0; i < myArray.length; i++){ +// Wrap this console.log withing a loop and replace 0 with i +for(let i = 0; i < myArray.length; i++) { console.log(myArray[i]); -} \ No newline at end of file +} From 3451060e3803d5a33c5ba9cea2975bd9d87760be Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:49:41 +0200 Subject: [PATCH 54/93] Update README.es.md --- exercises/05.1-Loop_Array/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/05.1-Loop_Array/README.es.md b/exercises/05.1-Loop_Array/README.es.md index 8c3c5df8..fe569c91 100644 --- a/exercises/05.1-Loop_Array/README.es.md +++ b/exercises/05.1-Loop_Array/README.es.md @@ -1,6 +1,6 @@ # `05.1` Loop an array -Ok, esta es la primera vez que vas a recorrer un loop o bucle desde cero. +Ok, esta es la primera vez que vas a recorrer un array desde cero. ## 馃摑 Instrucciones: From 0aa8e598d0d39095526f53a3615399a4ea82c153 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:54:54 +0200 Subject: [PATCH 55/93] Update README.md --- exercises/06.2-Loop-from-the-top/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/06.2-Loop-from-the-top/README.md b/exercises/06.2-Loop-from-the-top/README.md index 30c10308..068ac15e 100644 --- a/exercises/06.2-Loop-from-the-top/README.md +++ b/exercises/06.2-Loop-from-the-top/README.md @@ -10,12 +10,12 @@ This loop is looping the array from beginning to end... increasing one by one. 1. Try looping from the end to the beginning. -## Expected result: +## 馃捇 Expected result: ![image](../../.learn/assets/06.2.png) -## 馃挕 Hint: +## 馃挕 Hints: -+ Remember the loop works like [this](https://www.youtube.com/watch?v=TSMzvFwpE_A) ++ Remember that [loops work like this](https://www.youtube.com/watch?v=TSMzvFwpE_A). -+ The last position of the array will be `mySampleArray.length - 1` because arrays start at 0 \ No newline at end of file ++ The last position of the array will be `mySampleArray.length - 1` because arrays start at 0. From 14da688fb044dd66d89a1ce1d88d628999b72b56 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:55:15 +0200 Subject: [PATCH 56/93] Update README.md --- exercises/06.2-Loop-from-the-top/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.2-Loop-from-the-top/README.md b/exercises/06.2-Loop-from-the-top/README.md index 068ac15e..c443bd4b 100644 --- a/exercises/06.2-Loop-from-the-top/README.md +++ b/exercises/06.2-Loop-from-the-top/README.md @@ -4,7 +4,7 @@ tutorial: https://www.youtube.com/watch?v=IX2m3SWq7tg # `06.2` Loop from the top -This loop is looping the array from beginning to end... increasing one by one. +This loop is looping the array from beginning to end, increasing one by one. ## 馃摑 Instructions: From af07dd6f369229286475b2e5f715a416b04a3c05 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:57:23 +0200 Subject: [PATCH 57/93] Update app.js --- exercises/06.2-Loop-from-the-top/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.2-Loop-from-the-top/app.js b/exercises/06.2-Loop-from-the-top/app.js index 79b11d5c..0d4498bb 100644 --- a/exercises/06.2-Loop-from-the-top/app.js +++ b/exercises/06.2-Loop-from-the-top/app.js @@ -1,7 +1,7 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; -for(let i = 0; i Date: Wed, 6 Sep 2023 15:00:45 +0200 Subject: [PATCH 58/93] Update tests.js --- exercises/06.2-Loop-from-the-top/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.2-Loop-from-the-top/tests.js b/exercises/06.2-Loop-from-the-top/tests.js index 897c34b7..018600e1 100644 --- a/exercises/06.2-Loop-from-the-top/tests.js +++ b/exercises/06.2-Loop-from-the-top/tests.js @@ -17,8 +17,8 @@ it('Call the console.log function inside the loop', function () { expect(console.log.mock.calls.length).toBe(14); }); -it('Print the array from top to bottom, starting at mySampleArray.length-1 and ending at >= 0', function () { +it('Print the array from last to first item, starting at mySampleArray.length-1 and ending at >= 0', function () { const app = rewire('./app.js'); const variable = app.__get__('mySampleArray'); expect(_buffer).toMatch(variable.reverse().map(n => n+"\n").join("")); -}); \ No newline at end of file +}); From 189d57be7f56e09b78a8299bb3a5549092168059 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:04:43 +0200 Subject: [PATCH 59/93] Update README.md --- exercises/06.3-Loop-adding-two/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06.3-Loop-adding-two/README.md b/exercises/06.3-Loop-adding-two/README.md index 9c411b59..74add1cb 100644 --- a/exercises/06.3-Loop-adding-two/README.md +++ b/exercises/06.3-Loop-adding-two/README.md @@ -2,7 +2,7 @@ tutorial: https://www.youtube.com/watch?v=VpXGQbY6UFs --- -# `06.3` Loop adding two +# `06.3` Loop every two positions This code is looping the whole array, one by one, and printing the items on the console. @@ -10,7 +10,7 @@ This code is looping the whole array, one by one, and printing the items on the 1. Change the loop so it loops two by two instead of one by one. -## Expected result: +## 馃捇 Expected result: ```js 3423 @@ -20,4 +20,4 @@ This code is looping the whole array, one by one, and printing the items on the 48 55 25 -``` \ No newline at end of file +``` From 62080f292872c6472286f3375bea48aee42ff203 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:09:06 +0200 Subject: [PATCH 60/93] Update README.es.md --- exercises/06.3-Loop-adding-two/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/06.3-Loop-adding-two/README.es.md b/exercises/06.3-Loop-adding-two/README.es.md index b44bdcac..85435458 100644 --- a/exercises/06.3-Loop-adding-two/README.es.md +++ b/exercises/06.3-Loop-adding-two/README.es.md @@ -1,12 +1,12 @@ -# `06.3` Loop de dos en dos +# `06.3` Loop every two positions -Este c贸digo est谩 reproduciendo todo el conjunto, uno por uno, e imprime los elementos en la consola. +Este c贸digo est谩 recorriendo todo el array uno por uno, imprimiendo cada elemento en la consola. ## 馃摑 Instrucciones: -1. Cambia el bucle para que se repita de dos en dos en lugar de uno por uno. +1. Cambia el bucle para que recorra de dos en dos en lugar de uno por uno. -## Resultado esperado: +## 馃捇 Resultado esperado: ```js 3423 @@ -16,4 +16,4 @@ Este c贸digo est谩 reproduciendo todo el conjunto, uno por uno, e imprime los el 48 55 25 -``` \ No newline at end of file +``` From f65c57de0d770562bcb2993266d588479e66587e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:09:26 +0200 Subject: [PATCH 61/93] Update README.md --- exercises/06.3-Loop-adding-two/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.3-Loop-adding-two/README.md b/exercises/06.3-Loop-adding-two/README.md index 74add1cb..39f9f539 100644 --- a/exercises/06.3-Loop-adding-two/README.md +++ b/exercises/06.3-Loop-adding-two/README.md @@ -8,7 +8,7 @@ This code is looping the whole array, one by one, and printing the items on the ## 馃摑 Instructions: -1. Change the loop so it loops two by two instead of one by one. +1. Change the loop, so it loops two by two instead of one by one. ## 馃捇 Expected result: From cbcee32e6613e12d81d7f49e30e1f981d525e893 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:10:35 +0200 Subject: [PATCH 62/93] Update app.js --- exercises/06.3-Loop-adding-two/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.3-Loop-adding-two/app.js b/exercises/06.3-Loop-adding-two/app.js index 79b11d5c..0d4498bb 100644 --- a/exercises/06.3-Loop-adding-two/app.js +++ b/exercises/06.3-Loop-adding-two/app.js @@ -1,7 +1,7 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; -for(let i = 0; i Date: Wed, 6 Sep 2023 15:10:49 +0200 Subject: [PATCH 63/93] Update solution.hide.js --- exercises/06.3-Loop-adding-two/solution.hide.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.3-Loop-adding-two/solution.hide.js b/exercises/06.3-Loop-adding-two/solution.hide.js index 51e9c674..a859d106 100644 --- a/exercises/06.3-Loop-adding-two/solution.hide.js +++ b/exercises/06.3-Loop-adding-two/solution.hide.js @@ -1,7 +1,7 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; -for(let i = 0; i Date: Wed, 6 Sep 2023 15:11:46 +0200 Subject: [PATCH 64/93] Update tests.js --- exercises/06.3-Loop-adding-two/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.3-Loop-adding-two/tests.js b/exercises/06.3-Loop-adding-two/tests.js index 76ce6dae..c5d8d449 100644 --- a/exercises/06.3-Loop-adding-two/tests.js +++ b/exercises/06.3-Loop-adding-two/tests.js @@ -13,7 +13,7 @@ it('Call the console.log function inside the loop', function () { expect(console.log.mock.calls.length).toBe(variable.length/2); }); -test('You have to use a "for" loop ', () => { +test('You have to use a "for" loop', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /for\s*/gm expect(regex.test(file.toString())).toBeTruthy(); @@ -23,4 +23,4 @@ it('Loop the array but jumping two items at a time instead of just one at a time const app = rewire('./app.js'); const variable = app.__get__('mySampleArray'); expect(_buffer).toMatch(variable.filter((n,i) => i % 2 == 0).map(n => n+"\n").join("")); -}); \ No newline at end of file +}); From 52a2483bfaeffe05d337fed254957972e1612f32 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:12:22 +0200 Subject: [PATCH 65/93] Update tests.js --- exercises/05.1-Loop_Array/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/05.1-Loop_Array/tests.js b/exercises/05.1-Loop_Array/tests.js index ae9df2d6..12287403 100644 --- a/exercises/05.1-Loop_Array/tests.js +++ b/exercises/05.1-Loop_Array/tests.js @@ -7,7 +7,7 @@ let _buffer = ''; global.console.log = console.log = jest.fn((text) => _buffer += text + "\n"); -test('You have to use a for loop', () => { +test('You have to use a "for" loop', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /for\s*/gm expect(regex.test(file.toString())).toBeTruthy(); @@ -24,4 +24,4 @@ it('Print every item on the console', function () { const app = rewire('./app.js'); const variable = app.__get__('myArray'); expect(_buffer).toMatch(variable.map(n => n+"\n").join("")); -}); \ No newline at end of file +}); From 696ad3b329de8cbdfd0fad9359c9803237b1bd96 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:12:48 +0200 Subject: [PATCH 66/93] Update tests.js --- exercises/04.2-Loop_from_seven_to_twelve/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.2-Loop_from_seven_to_twelve/tests.js b/exercises/04.2-Loop_from_seven_to_twelve/tests.js index 8e61b972..cc3b44fa 100644 --- a/exercises/04.2-Loop_from_seven_to_twelve/tests.js +++ b/exercises/04.2-Loop_from_seven_to_twelve/tests.js @@ -11,7 +11,7 @@ it('Call the console.log function on every cycle', function () { expect(console.log.mock.calls.length).toBe(6); }); -test('You have to use a for loop', () => { +test('You have to use a "for" loop', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /for\s*/gm expect(regex.test(file.toString())).toBeTruthy(); From 46807932007ea9915e8a2556eb6da7f59909008d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:12:57 +0200 Subject: [PATCH 67/93] Update tests.js --- exercises/04.1-Loop_from_one_to_seventeen/tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04.1-Loop_from_one_to_seventeen/tests.js b/exercises/04.1-Loop_from_one_to_seventeen/tests.js index b8af0348..0f1e6587 100644 --- a/exercises/04.1-Loop_from_one_to_seventeen/tests.js +++ b/exercises/04.1-Loop_from_one_to_seventeen/tests.js @@ -10,7 +10,7 @@ it('Call the console.log function on every cycle', function () { const app = require('./app.js'); expect(console.log.mock.calls.length).toBe(17); }); -test('You have to use a for loop', () => { +test('You have to use a "for" loop', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /for\s*/gm expect(regex.test(file.toString())).toBeTruthy(); From 2390635e64b9d6b5cc5b2db4f9c66ef28ab4ccba Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:16:37 +0200 Subject: [PATCH 68/93] Update README.md --- exercises/06.4-Loop-from-the-half-to-the-end/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/README.md b/exercises/06.4-Loop-from-the-half-to-the-end/README.md index 811bfcdf..de5665a5 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/README.md +++ b/exercises/06.4-Loop-from-the-half-to-the-end/README.md @@ -2,7 +2,7 @@ tutorial: https://www.youtube.com/watch?v=rZp3TrD8tto --- -# `06.4` Loop from the half to the end +# `06.4` Loop from half to the end This loop is not looping at all... because the variables `initialValue`, `stopValue` and `increasingValue` are equal to zero. @@ -10,11 +10,11 @@ This loop is not looping at all... because the variables `initialValue`, `stopVa 1. Change the value of those variables to make the loop print only the last half of the array. -### :bulb: Hint: +## 馃挕 Hint: + Change nothing but the value of those 3 variables! -### Expected result: +## 馃捇 Expected result: ```js 23 @@ -24,4 +24,4 @@ This loop is not looping at all... because the variables `initialValue`, `stopVa 23 25 12 -``` \ No newline at end of file +``` From 776a76c70b27ce57db74fe573f5b1b3eea45604b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:19:12 +0200 Subject: [PATCH 69/93] Update README.es.md --- .../06.4-Loop-from-the-half-to-the-end/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md b/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md index af2ca91e..b37ae863 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md +++ b/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md @@ -1,4 +1,4 @@ -# `06.4` Loop desde la mitad hasta el final +# `06.4` Loop from half to the end Este bucle (loop) no est谩 recorriendo el arreglo porque las variables `initialValue`, `stopValue` y `increasingValue` son iguales a cero. @@ -6,11 +6,11 @@ Este bucle (loop) no est谩 recorriendo el arreglo porque las variables `initialV 1. Cambia el valor de esas variables para que el bucle imprima solo la 煤ltima mitad del arreglo. -### :bulb: Pista: +## 馃挕 Pista: -隆Solo cambia el valor de esas 3 variables! ++ 隆Solo cambia el valor de esas 3 variables! -### Resultado esperado: +## 馃捇 Resultado esperado: ```js 23 @@ -20,4 +20,4 @@ Este bucle (loop) no est谩 recorriendo el arreglo porque las variables `initialV 23 25 12 -``` \ No newline at end of file +``` From 22a782d7c446239f71b1115e10f805e05eef392b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:21:09 +0200 Subject: [PATCH 70/93] Update solution.hide.js --- .../06.4-Loop-from-the-half-to-the-end/solution.hide.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js b/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js index b8dad2bd..4adb9cb3 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js +++ b/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js @@ -2,9 +2,8 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; let initialValue = mySampleArray.length / 2; let stopValue = mySampleArray.length; -let increasingValue = 1; -for(let i = initialValue; i Date: Wed, 6 Sep 2023 15:21:21 +0200 Subject: [PATCH 71/93] Update solution.hide.js --- exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js b/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js index 4adb9cb3..026d0893 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js +++ b/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js @@ -3,7 +3,7 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; let initialValue = mySampleArray.length / 2; let stopValue = mySampleArray.length; -for(let i = initialValue; i Date: Wed, 6 Sep 2023 15:21:58 +0200 Subject: [PATCH 72/93] Update solution.hide.js --- exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js b/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js index 026d0893..d0879fa9 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js +++ b/exercises/06.4-Loop-from-the-half-to-the-end/solution.hide.js @@ -2,8 +2,9 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; let initialValue = mySampleArray.length / 2; let stopValue = mySampleArray.length; +let increasingValue = 1; -for(let i = initialValue; i < stopValue; i = i + 1) +for(let i = initialValue; i < stopValue; i = i + increasingValue) { console.log(mySampleArray[i]); } From 74cee258c09271618a376253a6fd892c0536d54c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:22:21 +0200 Subject: [PATCH 73/93] Update app.js --- exercises/06.4-Loop-from-the-half-to-the-end/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/app.js b/exercises/06.4-Loop-from-the-half-to-the-end/app.js index 3e1a93cb..6ee2589a 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/app.js +++ b/exercises/06.4-Loop-from-the-half-to-the-end/app.js @@ -4,7 +4,7 @@ let initialValue = 0; let stopValue = 0; let increasingValue = 1; -for(let i = initialValue; i Date: Wed, 6 Sep 2023 15:24:26 +0200 Subject: [PATCH 74/93] Update app.js --- exercises/06.4-Loop-from-the-half-to-the-end/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/app.js b/exercises/06.4-Loop-from-the-half-to-the-end/app.js index 6ee2589a..697e1894 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/app.js +++ b/exercises/06.4-Loop-from-the-half-to-the-end/app.js @@ -2,7 +2,7 @@ let mySampleArray = [3423,5,4,47889,654,8,867543,23,48,56432,55,23,25,12]; let initialValue = 0; let stopValue = 0; -let increasingValue = 1; +let increasingValue = 0; for(let i = initialValue; i < stopValue; i = i + increasingValue) { From 655695d15579eb8e7c38465d40d27ce320338ff0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:24:50 +0200 Subject: [PATCH 75/93] Update README.md --- exercises/06.4-Loop-from-the-half-to-the-end/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/README.md b/exercises/06.4-Loop-from-the-half-to-the-end/README.md index de5665a5..522d7957 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/README.md +++ b/exercises/06.4-Loop-from-the-half-to-the-end/README.md @@ -4,7 +4,7 @@ tutorial: https://www.youtube.com/watch?v=rZp3TrD8tto # `06.4` Loop from half to the end -This loop is not looping at all... because the variables `initialValue`, `stopValue` and `increasingValue` are equal to zero. +This loop is not looping at all... because the variables `initialValue`, `stopValue` and `increasingValue` are equal to zero `0`. ## 馃摑 Instructions: From 5544961b6ef94659ffb0bc84d880cf20528ed40c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:25:20 +0200 Subject: [PATCH 76/93] Update README.es.md --- exercises/06.4-Loop-from-the-half-to-the-end/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md b/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md index b37ae863..85168da7 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md +++ b/exercises/06.4-Loop-from-the-half-to-the-end/README.es.md @@ -1,6 +1,6 @@ # `06.4` Loop from half to the end -Este bucle (loop) no est谩 recorriendo el arreglo porque las variables `initialValue`, `stopValue` y `increasingValue` son iguales a cero. +Este bucle (loop) no est谩 recorriendo el arreglo porque las variables `initialValue`, `stopValue` y `increasingValue` son iguales a cero `0`. ## 馃摑 Instrucciones: From b63d7558f37ae9daf89111279e809e0e1feed8e6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:26:22 +0200 Subject: [PATCH 77/93] Update tests.js --- exercises/06.4-Loop-from-the-half-to-the-end/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06.4-Loop-from-the-half-to-the-end/tests.js b/exercises/06.4-Loop-from-the-half-to-the-end/tests.js index e3ddf542..a12ad9f5 100644 --- a/exercises/06.4-Loop-from-the-half-to-the-end/tests.js +++ b/exercises/06.4-Loop-from-the-half-to-the-end/tests.js @@ -36,8 +36,8 @@ it('Print in the console as you loop the array', function () { expect(_buffer).toMatch(variable.filter((n,i) => i > (variable.length / 2)).map(n => n+"\n").join("")); }); -test('You have to use for loop', () => { +test('You have to use a "for" loop', () => { const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); const regex = /for\s*/gm expect(regex.test(file.toString())).toBeTruthy(); -}) \ No newline at end of file +}) From 0ca7871157ada8132edd56183d780ab9a44c426a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:45:06 +0200 Subject: [PATCH 78/93] Update README.md --- exercises/06.5-One-last-looping/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/06.5-One-last-looping/README.md b/exercises/06.5-One-last-looping/README.md index 2447bb3b..3b1cb2d0 100644 --- a/exercises/06.5-One-last-looping/README.md +++ b/exercises/06.5-One-last-looping/README.md @@ -4,17 +4,17 @@ tutorial: https://www.youtube.com/watch?v=IwDDj6wN4jY # `06.5` One Last Looping - ## 馃摑 Instructions: -1. Without using the `array.reverse` function, please reverse loop (from the end to the beginning) the whole array and print all the items on the console as you go. +1. Without using the `reverse()` method, please reverse loop (from the end to the beginning) the whole array and print all the items on the console as you go. + ## 馃挕 Hint: + Use a `for()` loop like we have been using in previous exercises. + Remember that arrays start at position `0`. -### Expected result: +## 馃捇 Expected result: ```js Annie @@ -28,4 +28,4 @@ Lebron Ruth Kiko Esmeralda -``` \ No newline at end of file +``` From 9fe0c666c09ff089c2aa82a27c27d365656b774e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:45:34 +0200 Subject: [PATCH 79/93] Update README.md --- exercises/06.5-One-last-looping/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.5-One-last-looping/README.md b/exercises/06.5-One-last-looping/README.md index 3b1cb2d0..111955a1 100644 --- a/exercises/06.5-One-last-looping/README.md +++ b/exercises/06.5-One-last-looping/README.md @@ -16,7 +16,7 @@ tutorial: https://www.youtube.com/watch?v=IwDDj6wN4jY ## 馃捇 Expected result: -```js +```text Annie Bart Cesco From 124c9630f403d71f12915cf43720312fd8f163a2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:48:11 +0200 Subject: [PATCH 80/93] Update README.es.md --- exercises/06.5-One-last-looping/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/06.5-One-last-looping/README.es.md b/exercises/06.5-One-last-looping/README.es.md index d348cec6..52e06cee 100644 --- a/exercises/06.5-One-last-looping/README.es.md +++ b/exercises/06.5-One-last-looping/README.es.md @@ -1,16 +1,16 @@ -# `06.5` Un 煤ltimo loop +# `06.5` One Last Looping ## 馃摑 Instrucciones: -1. Sin usar la funci贸n `array.reverse`, invierte el bucle (desde el final hasta el principio) todo el arreglo o array e imprime todos los elementos en la consola a medida que lo recorre. +1. Sin usar el m茅todo `reverse()`, invierte el bucle (desde el final hasta el principio) todo el array e imprime todos los elementos en la consola a medida que lo recorre. ## 馃挕 Pista: -+ Usa un bucle `for ()` como lo hemos hecho en ejercicios anteriores. ++ Usa un bucle `for()` como lo hemos hecho en ejercicios anteriores. + Recuerda que los arreglos comienzan en la posici贸n `0`. -### Resultado esperado: +## 馃捇 Resultado esperado: ```js Annie From dc388474acdb693892610efa7f9ba6a4c15b3abd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:48:31 +0200 Subject: [PATCH 81/93] Update app.js --- exercises/06.5-One-last-looping/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.5-One-last-looping/app.js b/exercises/06.5-One-last-looping/app.js index d1cd02be..13857e27 100644 --- a/exercises/06.5-One-last-looping/app.js +++ b/exercises/06.5-One-last-looping/app.js @@ -1,3 +1,3 @@ let mySampleArray = ['Esmeralda', 'Kiko', 'Ruth', 'Lebron', 'Pedro', 'Maria', 'Lou', 'Fernando', 'Cesco', 'Bart', 'Annie']; -//your code here \ No newline at end of file +// Your code here From 03173d8c89e855d25b6605beb6ee357c15e7cf51 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:48:56 +0200 Subject: [PATCH 82/93] Update solution.hide.js --- exercises/06.5-One-last-looping/solution.hide.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06.5-One-last-looping/solution.hide.js b/exercises/06.5-One-last-looping/solution.hide.js index c91984c5..9457630a 100644 --- a/exercises/06.5-One-last-looping/solution.hide.js +++ b/exercises/06.5-One-last-looping/solution.hide.js @@ -1,7 +1,7 @@ let mySampleArray = ['Esmeralda', 'Kiko', 'Ruth', 'Lebron', 'Pedro', 'Maria', 'Lou', 'Fernando', 'Cesco', 'Bart', 'Annie']; -//your code here -for (let i = mySampleArray.length - 1; i >= 0; i = i -1) { +// Your code here +for (let i = mySampleArray.length - 1; i >= 0; i = i - 1) { let item = mySampleArray[i]; console.log(item) -} \ No newline at end of file +} From 4207020e8fb61907550535e736bed116cac8fe59 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:50:16 +0200 Subject: [PATCH 83/93] Update tests.js --- exercises/06.5-One-last-looping/tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06.5-One-last-looping/tests.js b/exercises/06.5-One-last-looping/tests.js index 26d82060..92d5d9ad 100644 --- a/exercises/06.5-One-last-looping/tests.js +++ b/exercises/06.5-One-last-looping/tests.js @@ -8,7 +8,7 @@ global.console.log = console.log = jest.fn((text) => _buffer += text + "\n"); let reverse = Array.prototype.reverse; Array.prototype.reverse = jest.fn(function(){ return this; }); -test("Remember that your for loop must start by declaring a variable let or var", function(){ +test('Remember that your "for" loop must start by declaring a variable let or var', function(){ const content = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); expect(/for\s*\(\s*(let|var)\s*/.test(content)).toBe(true) }) @@ -27,7 +27,7 @@ test('Do not use the reverse function', function () { expect(appContent.includes('.reverse(')).toBe(false); }); -test('Loop the array in a reverse order and console.log all of its item', function () { +test('Loop the array in a reverse order and console.log all of its items', function () { const _app = rewire('./app.js'); const variable = _app.__get__('mySampleArray'); let inverted = []; @@ -35,4 +35,4 @@ test('Loop the array in a reverse order and console.log all of its item', functi inverted.push(variable[i]); } expect(_buffer).toMatch(inverted.map(n => n+"\n").join("")); -}); \ No newline at end of file +}); From bb78770657ccec4b269528c640e047726999afa1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:50:46 +0200 Subject: [PATCH 84/93] Update README.md --- exercises/06.5-One-last-looping/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.5-One-last-looping/README.md b/exercises/06.5-One-last-looping/README.md index 111955a1..5f6eda17 100644 --- a/exercises/06.5-One-last-looping/README.md +++ b/exercises/06.5-One-last-looping/README.md @@ -8,7 +8,7 @@ tutorial: https://www.youtube.com/watch?v=IwDDj6wN4jY 1. Without using the `reverse()` method, please reverse loop (from the end to the beginning) the whole array and print all the items on the console as you go. -## 馃挕 Hint: +## 馃挕 Hints: + Use a `for()` loop like we have been using in previous exercises. From c32aba6125569e50834ffeb0dc263309a24af085 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:50:52 +0200 Subject: [PATCH 85/93] Update README.es.md --- exercises/06.5-One-last-looping/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.5-One-last-looping/README.es.md b/exercises/06.5-One-last-looping/README.es.md index 52e06cee..9452f0e2 100644 --- a/exercises/06.5-One-last-looping/README.es.md +++ b/exercises/06.5-One-last-looping/README.es.md @@ -4,7 +4,7 @@ 1. Sin usar el m茅todo `reverse()`, invierte el bucle (desde el final hasta el principio) todo el array e imprime todos los elementos en la consola a medida que lo recorre. -## 馃挕 Pista: +## 馃挕 Pistas: + Usa un bucle `for()` como lo hemos hecho en ejercicios anteriores. From 8876cd5ee3086ecdbdf2c1dd07d90e5ab2d2e620 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:07:00 +0200 Subject: [PATCH 86/93] Update README.es.md --- exercises/06.5-One-last-looping/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/06.5-One-last-looping/README.es.md b/exercises/06.5-One-last-looping/README.es.md index 9452f0e2..810b349d 100644 --- a/exercises/06.5-One-last-looping/README.es.md +++ b/exercises/06.5-One-last-looping/README.es.md @@ -12,7 +12,7 @@ ## 馃捇 Resultado esperado: -```js +```text Annie Bart Cesco From 58a419ccc9041c1b29cc00c97215d2919185101a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:08:45 +0200 Subject: [PATCH 87/93] Update README.md --- exercises/07.1-Finding-Waldo/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/07.1-Finding-Waldo/README.md b/exercises/07.1-Finding-Waldo/README.md index c1fd8fc9..f09b0c19 100644 --- a/exercises/07.1-Finding-Waldo/README.md +++ b/exercises/07.1-Finding-Waldo/README.md @@ -2,22 +2,22 @@ tutorial: https://www.youtube.com/watch?v=5WphKLyEJaU --- -# `07.1` Find Waldo :smile: +# `07.1` Finding Waldo 馃槃 ![Finding Waldo](../../.learn/assets/finding_waldo.jpeg) -Have you ever played finding Waldo? I used to play it a lot when I was little, this exercise is a digital version of finding Waldo. +Have you ever played "Where's Waldo?" I used to play it a lot when I was little, this exercise is a digital version of Where's Waldo. -## :pencil: Instructions: +## 馃摑 Instructions: 1. Please loop this entire array and print the positions where the string "Waldo" is found. -### :bulb: Hint +## 馃挕 Hints: + You need to add a conditional inside the loop. -+ Waldo may be upper case or lowercase, compare both values [using toLowerCase()](https://www.geeksforgeeks.org/compare-the-case-insensitive-strings-in-javascript/) ++ Waldo may be uppercase or lowercase, compare both values [using toLowerCase()](https://www.geeksforgeeks.org/compare-the-case-insensitive-strings-in-javascript/) -### :egg: Easter Egg: +## 馃 Easter Egg: -What if there is more than one Waldo? ++ What if there is more than one Waldo? From 27df11d81bd2ebc738f2b3bd96c8ac76f69e784b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:17:01 +0200 Subject: [PATCH 88/93] Update README.es.md --- exercises/07.1-Finding-Waldo/README.es.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/07.1-Finding-Waldo/README.es.md b/exercises/07.1-Finding-Waldo/README.es.md index 35d371f8..c5fa24f3 100644 --- a/exercises/07.1-Finding-Waldo/README.es.md +++ b/exercises/07.1-Finding-Waldo/README.es.md @@ -1,18 +1,18 @@ -# `07.1` Encuentra a Waldo (Wally) :smile: +# `07.1` Finding Waldo 馃槃 ![Finding Waldo](../../.learn/assets/finding_waldo.jpeg) -驴Alguna vez has jugado a encontrar a Waldo (o Wally)? Sol铆a jugar mucho cuando era peque帽o, este ejercicio es una versi贸n digital de encontrar a Waldo. +驴Alguna vez has jugado "D贸nde Est谩 Waldo?" Sol铆a jugar mucho cuando era peque帽o, este ejercicio es una versi贸n digital de encontrar a Waldo. -## :pencil: Instrucciones: +## 馃摑 Instrucciones: -1. Haz un bucle en este arreglo o array que lo recorra por completo e imprima las posiciones donde se encuentra el string "Waldo". +1. Haz un bucle en este array que lo recorra por completo e imprima las posiciones donde se encuentra el string "Waldo". -### :bulb: Pista +## 馃挕 Pistas: -+ Necesitas agregar un condicional dentro del bucle.. ++ Necesitas agregar un condicional dentro del bucle. -+ Waldo puede ser may煤scula o min煤scula, compara ambos valores [usando toLowerCase()](https://www.geeksforgeeks.org/compare-the-case-insensitive-strings-in-javascript/) ++ Waldo puede ser may煤scula o min煤scula, compara ambos valores [usando toLowerCase()](https://www.geeksforgeeks.org/compare-the-case-insensitive-strings-in-javascript/). -### :egg: Easter Egg: +## 馃 Easter Egg: -驴Qu茅 pasa si hay m谩s de un Waldo? \ No newline at end of file ++ 驴Qu茅 pasa si hay m谩s de un Waldo? From d04dbb72bf7e2ed9062cb5ae8303e9254b68f21e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:19:15 +0200 Subject: [PATCH 89/93] Update README.md --- exercises/07.1-Finding-Waldo/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07.1-Finding-Waldo/README.md b/exercises/07.1-Finding-Waldo/README.md index f09b0c19..00627024 100644 --- a/exercises/07.1-Finding-Waldo/README.md +++ b/exercises/07.1-Finding-Waldo/README.md @@ -16,7 +16,7 @@ Have you ever played "Where's Waldo?" I used to play it a lot when I was little, + You need to add a conditional inside the loop. -+ Waldo may be uppercase or lowercase, compare both values [using toLowerCase()](https://www.geeksforgeeks.org/compare-the-case-insensitive-strings-in-javascript/) ++ Waldo may be uppercase or lowercase, compare both values [using toLowerCase()](https://www.geeksforgeeks.org/compare-the-case-insensitive-strings-in-javascript/). ## 馃 Easter Egg: From ec8ecfa4b72885fa4ea86066e60bd537551f3d89 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:20:23 +0200 Subject: [PATCH 90/93] Update app.js --- exercises/07.1-Finding-Waldo/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07.1-Finding-Waldo/app.js b/exercises/07.1-Finding-Waldo/app.js index 7c498a2b..afb7ce6d 100644 --- a/exercises/07.1-Finding-Waldo/app.js +++ b/exercises/07.1-Finding-Waldo/app.js @@ -1,3 +1,3 @@ let people = [ 'Lebron','Aaliyah','Diamond','Dominique','Aliyah','Jazmin','Darnell','Hatfield','Hawkins','Hayden','Hayes','Haynes','Hays','Head','Heath','Hebert','Henderson','Hendricks','Hendrix','Henry','Hensley','Henson','Herman','Hernandez','Herrera','Herring','Hess','Hester','Hewitt','Hickman','Hicks','Higgins','Hill','Hines','Hinton','Hobbs','Hodge','Hodges','Hoffman','Hogan','Holcomb','Holden','Holder','Holland','Holloway','Holman','Holmes','Holt','Hood','Hooper','Hoover','Hopkins','Hopper','Horn','Horne','Horton','House','Houston','Howard','Howe','Howell','Hubbard','Huber','Hudson','Huff','Waldo','Hughes','Hull','Humphrey','Hunt','Hunter','Hurley','Hurst','Hutchinson','Hyde','Ingram','Irwin','Jackson','Jacobs','Jacobson','James','Jarvis','Jefferson','Jenkins','Jennings','Jensen','Jimenez','Johns','Johnson','Johnston','Jones','Jordan','Joseph','Joyce','Joyner','Juarez','Justice','Kane','Kaufman','Keith','Keller','Kelley','Kelly','Kemp','Kennedy','Kent','Kerr','Key','Kidd','Kim','King','Kinney','Kirby','Kirk','Kirkland','Klein','Kline','Knapp','Knight','Knowles','Knox','Koch','Kramer','Lamb','Lambert','Lancaster','Landry','Lane','Lang','Langley','Lara','Larsen','Larson','Lawrence','Lawson','Le','Leach','Leblanc','Lee','Leon','Leonard','Lester','Levine','Levy','Lewis','Lindsay','Lindsey','Little','Livingston','Lloyd','Logan','Long','Lopez','Lott','Love','Lowe','Lowery','Lucas','Luna','Lynch','Lynn','Lyons','Macdonald','Macias','Mack','Madden','Maddox','Maldonado','Malone','Mann','Manning','Marks','Marquez','Marsh','Marshall','Martin','Martinez','Mason','Massey','Mathews','Mathis','Matthews','Maxwell','May','Mayer','Maynard','Mayo','Mays','Mcbride','Mccall','Mccarthy','Mccarty','Mcclain','Mcclure','Mcconnell','Mccormick','Mccoy','Mccray','Waldo','Mcdaniel','Mcdonald','Mcdowell','Mcfadden','Mcfarland','Mcgee','Mcgowan','Mcguire','Mcintosh','Mcintyre','Mckay','Mckee','Mckenzie','Mckinney','Mcknight','Mclaughlin','Mclean','Mcleod','Mcmahon','Mcmillan','Mcneil','Mcpherson','Meadows','Medina','Mejia','Melendez','Melton','Mendez','Mendoza','Mercado','Mercer','Merrill','Merritt','Meyer','Meyers','Michael','Middleton','Miles','Miller','Mills','Miranda','Mitchell','Molina','Monroe','Lucas','Jake','Scott','Amy','Molly','Hannah','Lucas'] ; -//loop here to find waldo, use the if conditionals \ No newline at end of file +// Loop here to find waldo, use the if conditionals From 73fa6e8dc599bff383253f96b9919f7b4f9098e2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:20:56 +0200 Subject: [PATCH 91/93] Update app.js --- exercises/07.1-Finding-Waldo/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07.1-Finding-Waldo/app.js b/exercises/07.1-Finding-Waldo/app.js index afb7ce6d..e73f48e0 100644 --- a/exercises/07.1-Finding-Waldo/app.js +++ b/exercises/07.1-Finding-Waldo/app.js @@ -1,3 +1,3 @@ let people = [ 'Lebron','Aaliyah','Diamond','Dominique','Aliyah','Jazmin','Darnell','Hatfield','Hawkins','Hayden','Hayes','Haynes','Hays','Head','Heath','Hebert','Henderson','Hendricks','Hendrix','Henry','Hensley','Henson','Herman','Hernandez','Herrera','Herring','Hess','Hester','Hewitt','Hickman','Hicks','Higgins','Hill','Hines','Hinton','Hobbs','Hodge','Hodges','Hoffman','Hogan','Holcomb','Holden','Holder','Holland','Holloway','Holman','Holmes','Holt','Hood','Hooper','Hoover','Hopkins','Hopper','Horn','Horne','Horton','House','Houston','Howard','Howe','Howell','Hubbard','Huber','Hudson','Huff','Waldo','Hughes','Hull','Humphrey','Hunt','Hunter','Hurley','Hurst','Hutchinson','Hyde','Ingram','Irwin','Jackson','Jacobs','Jacobson','James','Jarvis','Jefferson','Jenkins','Jennings','Jensen','Jimenez','Johns','Johnson','Johnston','Jones','Jordan','Joseph','Joyce','Joyner','Juarez','Justice','Kane','Kaufman','Keith','Keller','Kelley','Kelly','Kemp','Kennedy','Kent','Kerr','Key','Kidd','Kim','King','Kinney','Kirby','Kirk','Kirkland','Klein','Kline','Knapp','Knight','Knowles','Knox','Koch','Kramer','Lamb','Lambert','Lancaster','Landry','Lane','Lang','Langley','Lara','Larsen','Larson','Lawrence','Lawson','Le','Leach','Leblanc','Lee','Leon','Leonard','Lester','Levine','Levy','Lewis','Lindsay','Lindsey','Little','Livingston','Lloyd','Logan','Long','Lopez','Lott','Love','Lowe','Lowery','Lucas','Luna','Lynch','Lynn','Lyons','Macdonald','Macias','Mack','Madden','Maddox','Maldonado','Malone','Mann','Manning','Marks','Marquez','Marsh','Marshall','Martin','Martinez','Mason','Massey','Mathews','Mathis','Matthews','Maxwell','May','Mayer','Maynard','Mayo','Mays','Mcbride','Mccall','Mccarthy','Mccarty','Mcclain','Mcclure','Mcconnell','Mccormick','Mccoy','Mccray','Waldo','Mcdaniel','Mcdonald','Mcdowell','Mcfadden','Mcfarland','Mcgee','Mcgowan','Mcguire','Mcintosh','Mcintyre','Mckay','Mckee','Mckenzie','Mckinney','Mcknight','Mclaughlin','Mclean','Mcleod','Mcmahon','Mcmillan','Mcneil','Mcpherson','Meadows','Medina','Mejia','Melendez','Melton','Mendez','Mendoza','Mercado','Mercer','Merrill','Merritt','Meyer','Meyers','Michael','Middleton','Miles','Miller','Mills','Miranda','Mitchell','Molina','Monroe','Lucas','Jake','Scott','Amy','Molly','Hannah','Lucas'] ; -// Loop here to find waldo, use the if conditionals +// Loop here to find waldo, use an if conditional inside the loop From 0cafe37a72dabbcc164033ad2529792795694a69 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:22:24 +0200 Subject: [PATCH 92/93] Update solution.hide.js --- exercises/07.1-Finding-Waldo/solution.hide.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/07.1-Finding-Waldo/solution.hide.js b/exercises/07.1-Finding-Waldo/solution.hide.js index 618a492b..f8cf4582 100644 --- a/exercises/07.1-Finding-Waldo/solution.hide.js +++ b/exercises/07.1-Finding-Waldo/solution.hide.js @@ -1,10 +1,10 @@ let people = [ 'Lebron','Aaliyah','Diamond','Dominique','Aliyah','Jazmin','Darnell','Hatfield','Hawkins','Hayden','Hayes','Haynes','Hays','Head','Heath','Hebert','Henderson','Hendricks','Hendrix','Henry','Hensley','Henson','Herman','Hernandez','Herrera','Herring','Hess','Hester','Hewitt','Hickman','Hicks','Higgins','Hill','Hines','Hinton','Hobbs','Hodge','Hodges','Hoffman','Hogan','Holcomb','Holden','Holder','Holland','Holloway','Holman','Holmes','Holt','Hood','Hooper','Hoover','Hopkins','Hopper','Horn','Horne','Horton','House','Houston','Howard','Howe','Howell','Hubbard','Huber','Hudson','Huff','Waldo','Hughes','Hull','Humphrey','Hunt','Hunter','Hurley','Hurst','Hutchinson','Hyde','Ingram','Irwin','Jackson','Jacobs','Jacobson','James','Jarvis','Jefferson','Jenkins','Jennings','Jensen','Jimenez','Johns','Johnson','Johnston','Jones','Jordan','Joseph','Joyce','Joyner','Juarez','Justice','Kane','Kaufman','Keith','Keller','Kelley','Kelly','Kemp','Kennedy','Kent','Kerr','Key','Kidd','Kim','King','Kinney','Kirby','Kirk','Kirkland','Klein','Kline','Knapp','Knight','Knowles','Knox','Koch','Kramer','Lamb','Lambert','Lancaster','Landry','Lane','Lang','Langley','Lara','Larsen','Larson','Lawrence','Lawson','Le','Leach','Leblanc','Lee','Leon','Leonard','Lester','Levine','Levy','Lewis','Lindsay','Lindsey','Little','Livingston','Lloyd','Logan','Long','Lopez','Lott','Love','Lowe','Lowery','Lucas','Luna','Lynch','Lynn','Lyons','Macdonald','Macias','Mack','Madden','Maddox','Maldonado','Malone','Mann','Manning','Marks','Marquez','Marsh','Marshall','Martin','Martinez','Mason','Massey','Mathews','Mathis','Matthews','Maxwell','May','Mayer','Maynard','Mayo','Mays','Mcbride','Mccall','Mccarthy','Mccarty','Mcclain','Mcclure','Mcconnell','Mccormick','Mccoy','Mccray','Waldo','Mcdaniel','Mcdonald','Mcdowell','Mcfadden','Mcfarland','Mcgee','Mcgowan','Mcguire','Mcintosh','Mcintyre','Mckay','Mckee','Mckenzie','Mckinney','Mcknight','Mclaughlin','Mclean','Mcleod','Mcmahon','Mcmillan','Mcneil','Mcpherson','Meadows','Medina','Mejia','Melendez','Melton','Mendez','Mendoza','Mercado','Mercer','Merrill','Merritt','Meyer','Meyers','Michael','Middleton','Miles','Miller','Mills','Miranda','Mitchell','Molina','Monroe','Lucas','Jake','Scott','Amy','Molly','Hannah','Lucas'] ; -//loop here to find Waldo, use the if conditionals +// Loop here to find waldo, use an if conditional inside the loop -for(let i =0;i Date: Wed, 6 Sep 2023 16:23:48 +0200 Subject: [PATCH 93/93] Update tests.js --- exercises/07.1-Finding-Waldo/tests.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/07.1-Finding-Waldo/tests.js b/exercises/07.1-Finding-Waldo/tests.js index caa0a961..f2e8fe97 100644 --- a/exercises/07.1-Finding-Waldo/tests.js +++ b/exercises/07.1-Finding-Waldo/tests.js @@ -13,7 +13,7 @@ it('You have to use the console.log function inside the loop', function () { expect(console.log.mock.calls.length > 0).toBe(true); }); -it('Use a for loop', function () { +it('Use a "for" loop', function () { const app_content = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8'); expect(app_content).toMatch(/for(\s*)\(/); }); @@ -23,9 +23,9 @@ it('Use the toLowerCase function', function () { expect(app_content).toMatch(/\.toLowerCase(\s*)\(/); }); -it('Loop and add a conditional to print the position (i) where Waldo was fund', function () { +it('Loop and add a conditional to print the position (i) where Waldo was found', function () { const _app = rewire('./app.js'); const people = _app.__get__('people'); const position = people.indexOf("Waldo"); expect(_buffer.includes(position+"\n")).toBe(true); -}); \ No newline at end of file +});