Skip to content

Commit ea6cf33

Browse files
authored
Merge pull request #136 from josemoracard/jose3-01-hello_world
exercises 01-hello-world to 07.1-finding-waldo
2 parents 7054e65 + 357d5c3 commit ea6cf33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+208
-239
lines changed

exercises/01-Hello_World/README.es.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# `01` Hello World
22

3-
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`.
3+
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**.
44

55
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).
66

7-
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.
7+
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.
88

99
Este es un ejemplo de cómo usarlo:
1010

@@ -14,7 +14,7 @@ console.log("How are you?");
1414

1515
## 📝 Instrucciones:
1616

17-
1. Usa `console.log` para imprimir "Hello World" en la consola. Siéntete libre de probar otras cosas también.
17+
1. Usa `console.log()` para imprimir "Hello World" en la consola. Siéntete libre de probar otras cosas también.
1818

1919
## 💡 Pista:
2020

exercises/01-Hello_World/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ tutorial: https://www.youtube.com/watch?v=miBzmGgMIbU
44

55
# `01` Hello World
66

7-
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`.
7+
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**.
88

9-
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).
9+
Every language has a console, as it was the only way to interact with the users at the beginning (before Windows or MacOS arrived).
1010

11-
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.
11+
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.
1212

1313
This is an example of how to use it:
1414

@@ -18,8 +18,8 @@ console.log("How are you?");
1818

1919
## 📝 Instructions:
2020

21-
1. Use console.log to print "Hello World" on the console. Feel free to try other things as well.
21+
1. Use `console.log()` to print "Hello World" on the console. Feel free to try other things as well.
2222

2323
## 💡 Hint:
2424

25-
+ 5 minutes video about the console: https://www.youtube.com/watch?v=1RlkftxAo-M
25+
+ 5 minute video about the console: https://www.youtube.com/watch?v=1RlkftxAo-M

exercises/01-Hello_World/tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let _log = console.log;
1111
// We make the text lower case to make it case insensitive
1212
global.console.log = console.log = jest.fn((text) => _buffer += text.toLowerCase() + "\n");
1313

14-
test('console.log() function should be called with Hello World', function () {
14+
test('console.log() function should be called with "Hello World"', function () {
1515

1616
/*
1717
Here is how to mock the alert function:

exercises/02.1-Access_and_retrieve/README.es.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','satu
1010

1111
Cada array tiene las siguientes partes:
1212

13-
- *Item*s*: son los valores reales dentro de cada posición del array (array).
13+
- **Items** (Elementos): son los valores dentro de cada posición del array.
1414

15-
- *Length* (Longitud): es el tamaño del array, el número de elementos.
15+
- **Length** (Longitud): es el tamaño del array, el número de elementos.
1616

17-
- *Index* (indice): es la posición de un elemento.
17+
- **Index** (Índice): es la posición de un elemento.
1818

1919
![Como funciona un array](../../.learn/assets/DbmSOHT.png?raw=true)
2020

21-
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.
21+
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.
2222

23-
**!IMPORTANTE: ¡Cada array comienza desde cero (0)!**
23+
**IMPORTANTE: ¡Cada array comienza desde cero (0)!**
2424

25-
## 📝 Instrucciones
25+
## 📝 Instrucciones:
2626

27-
1. Usando la función `console.log`, imprime el tercer elemento del array.
27+
1. Usando la función `console.log()`, imprime el tercer elemento del array.
2828

29-
2. Cambia el valor en la posición donde se encuentra `jueves` a `null` (nulo).
29+
2. Cambia el valor en la posición donde se encuentra `thursday` a `null`.
3030

31-
3. Imprime esa posición en particular.
31+
3. Imprime esa posición.
3232

3333
## 💡 Pista:
3434

35-
+ Usa `null` como valor y no como un string.
35+
+ Usa `null` como valor y no como un string.

exercises/02.1-Access_and_retrieve/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,31 @@ tutorial: https://www.youtube.com/watch?v=9-yAzjsWXtU
44

55
# `02.1` Access and Retrieve
66

7-
Arrays are part of every programming language. They are the way to go when you want to have a "list of elements."
7+
Arrays are part of every programming language. They are the way to go when you want to have a "list of elements".
88

99
For example, we could have an array that stores the days of the week:
1010

1111
```js
1212
let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
1313
```
14+
1415
Every array has the following parts:
1516

16-
- *Items*: are the actual values inside on each position of the array.
17+
- **Items**: are the actual values inside each position of the array.
1718

18-
- *Length*: is the size of the array, the number of items.
19+
- **Length**: is the size of the array, the number of items.
1920

20-
- *Index*: is the position of an element.
21+
- **Index**: is the position of an element (item).
2122

2223
![How arrays work](../../.learn/assets/DbmSOHT.png?raw=true)
2324

2425
To access any item within the array you need to know its index (position). The index is an integer value that represents the position in which the element is located.
2526

2627
**IMPORTANT: Every array starts from zero (0)!**
2728

28-
## 📝 Instructions
29+
## 📝 Instructions:
2930

30-
1. Using the `console.log` function, print the 3rd item from the array.
31+
1. Using the `console.log()` function, print the 3rd item from the array.
3132

3233
2. Change the value in the position where `thursday` is located to `null`.
3334

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//declaring the array
1+
// Declaring the array
22
let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
33

4-
//1. print the item here
4+
// 1. print the 3rd item here
55

6-
//2. change 'thursday'a value here to null
6+
// 2. change the 'thursday' value to null here
77

8-
//3. print the position of step 2
8+
// 3. print the position of step 2
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
//declaring the array
1+
// Declaring the array
22

3-
//. 0. 1. 2. 3. 4. 5. 6
3+
//. positions: 0 1 2 3 4 5 6
44
let myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
55

66

7-
//1. print the item here
8-
console.log(myArray[2])
7+
// 1. print the 3rd item here
8+
console.log(myArray[2]);
99

10-
//2. change 'thursday'a value here to null
10+
// 2. change 'thursday' value to null here
1111
myArray[4] = null;
1212

13-
//3. print the position of step 2
14-
console.log(myArray[4])
13+
// 3. print the position of step 2
14+
console.log(myArray[4]);

exercises/02.1-Access_and_retrieve/tests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ it('console.log() function should have been called 2 times', function () {
2020
expect(console.log.mock.calls.length).toBe(2);
2121
});
2222

23-
it('Print the third item on the array (position 2)', function () {
23+
it('Print the 3rd item of the array (position 2)', function () {
2424
//You can also compare the entire console buffer (if there have been several console.log calls on the exercise)
2525
expect(_buffer.includes("tuesday\n")).toBe(true);
2626
});
@@ -29,7 +29,7 @@ it('The fourth item in the array must be equal to "null"' , function(){
2929
expect(myArray[4]).toBe(null)
3030
})
3131

32-
it('Print the 4th position of the array', function () {
32+
it('Print the 4th position of the array (item 5)', function () {
3333
//You can also compare the entire console buffer (if there have been several console.log calls on the exercise)
3434
expect(_buffer.includes("null\n")).toBe(true);
35-
});
35+
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# `02.2` Retrieve Items
22

3-
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.
3+
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.
44

55
Debes envolver el índice entre corchetes de esta manera:
66

77
```js
88
let myValue = array[index];
99
```
1010

11-
## 📝 Instrucciones
11+
## 📝 Instrucciones:
1212

13-
1. Imprima en la consola el 1er elemento de array o arreglo.
13+
1. Imprima en la consola el 1er elemento del array.
1414

15-
2. Imprima en la consola el 4to elemento de la arreglo o array.
15+
2. Imprima en la consola el 4to elemento del array.

exercises/02.2-Retrieve_Items/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tutorial: https://www.youtube.com/watch?v=rWYIgofIAME
44

55
# `02.2` Retrieve Items
66

7-
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.
7+
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.
88

99
You need to wrap the index into brackets like this:
1010

@@ -14,6 +14,6 @@ let myValue = array[index];
1414

1515
## 📝 Instructions:
1616

17-
1. Print on the console the 1st element of the array
17+
1. Print on the console the 1st element of the array.
1818

19-
2. Print on the console the 4th element of the array
19+
2. Print on the console the 4th element of the array.

exercises/02.2-Retrieve_Items/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23];
22

3-
//your code here
3+
// your code here
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11

2-
// 0.1. 2. 3. 4. 5. 6.7. 8. 9. 10.....
2+
// 0.1. 2. 3. 4. 5. 6. 7. 8. 9. 10.....
33
let arr = [4,5,734,43,45,100,4,56,23,67,23,58,45,3,100,4,56,23];
44

5-
//your code here
6-
7-
let aux = arr[0];
5+
// your code here
86
console.log(arr[0]);
97

10-
11-
console.log(arr[3]);
8+
console.log(arr[3]);

exercises/02.2-Retrieve_Items/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ it('console.log() function should have been called 2 times', function () {
1717
expect(console.log.mock.calls.length).toBe(2);
1818
});
1919

20-
it('Print the 1st item on the array (position 2)', function () {
20+
it('Print the 1st item of the array (position 0)', function () {
2121
//You can also compare the entire console buffer (if there have been several console.log calls on the exercise)
2222
expect(_buffer.includes("4\n")).toBe(true);
2323
});
2424

2525
it('Print the 4th item of the array', function () {
2626
//You can also compare the entire console buffer (if there have been several console.log calls on the exercise)
2727
expect(_buffer.includes("43\n")).toBe(true);
28-
});
28+
});

exercises/03-Print_the_last_one/README.es.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Nunca sabrás cuántos elementos tiene `myStupidArray` porque se genera aleatoriamente durante el tiempo de ejecución utilizando la función `generateRandomArray`.
44

5-
¡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).
5+
¡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).
66

77
```js
88
let totalItems = myStupidArray.length;
@@ -12,4 +12,4 @@ let totalItems = myStupidArray.length;
1212

1313
1. Crea una variable llamada `theLastOne` y asígnale el último elemento de `myStupidArray`.
1414

15-
2. Luego, imprímelo en la consola.
15+
2. Luego, imprímelo en la consola.

exercises/03-Print_the_last_one/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ tutorial: https://www.youtube.com/watch?v=d-CnlwX6x1A
66

77
You will never know how many items `myStupidArray` has because it is being randomly generated during runtime using the `generateRandomArray` function.
88

9-
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).
9+
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).
1010

1111
```js
1212
let totalItems = myStupidArray.length;
1313
```
1414

15-
## 📝 Instructions
15+
## 📝 Instructions:
1616

17-
1. Create a variable named `theLastOne`, and assign it the LAST element of `myStupidArray`.
17+
1. Create a variable named `theLastOne`, and assign to it the LAST element of `myStupidArray`.
1818

1919
2. Then, print it on the console.

exercises/03-Print_the_last_one/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ function generateRandomArray()
77
}
88
let myStupidArray = generateRandomArray();
99

10-
//Your code here
10+
// Your code here

exercises/03-Print_the_last_one/solution.hide.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ function generateRandomArray()
22
{
33
let auxArray = [];
44
let randomLength = Math.floor(Math.random()*100);
5-
for(let i = 0;i<randomLength;i++) auxArray.push(Math.floor(Math.random()*100));
5+
for(let i = 0; i < randomLength; i++) auxArray.push(Math.floor(Math.random()*100));
66
return auxArray;
77
}
88
let myStupidArray = generateRandomArray();
99

10-
// 0. 1. 2
10+
// Your code here
1111
let theLastOne = myStupidArray[myStupidArray.length - 1];
1212
console.log(theLastOne)
1313

exercises/04.1-Loop_from_one_to_seventeen/README.es.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# `04.1` Loop from one to seventeen
22

3-
El loop (bucle) actual se repite del cero a diez,
3+
El loop (bucle) actual se repite del cero a diez.
44

55
## 📝 Instrucciones:
66

77
1. Por favor, haz un loop de 1 a 17.
88

9-
## Ejemplo de salida:
9+
## 💻 Ejemplo de salida:
1010

1111
```js
1212
1
@@ -28,8 +28,8 @@ El loop (bucle) actual se repite del cero a diez,
2828
17
2929
```
3030

31-
## 💡 Pista:
31+
## 💡 Pistas:
3232

3333
+ Tienes que recorrer del 1 al 17 (no del 0 al 17).
3434

35-
+ Aquí esta un [video de 2 min explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
35+
+ Aquí está un [video de 6 minutos explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).

exercises/04.1-Loop_from_one_to_seventeen/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ tutorial: https://www.youtube.com/watch?v=4QGaROXZ3oc
44

55
# `04.1` Loop from one to seventeen
66

7-
The current loop is looping from zero to ten,
7+
The current loop is looping from zero to ten.
88

9-
## 📝 Instructions
9+
## 📝 Instructions:
1010

1111
1. Please make it loop from 1 to 17.
1212

13-
## Example output:
13+
## 💻 Example output:
1414

1515
```js
1616
1
@@ -36,4 +36,4 @@ The current loop is looping from zero to ten,
3636

3737
+ You have to loop from 1 to 17 (not from 0 to 17).
3838

39-
+ Here is a [2 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
39+
+ Here is a [6 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//change the conditions of the for loop
2-
for(let number = 0; number < 10; number++){
3-
//print the number
1+
// Change the conditions of the for loop
2+
for(let number = 0; number < 10; number++) {
3+
// Print the number
44
}

0 commit comments

Comments
 (0)