Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e6cae92
Update README.md
josemoracard Sep 6, 2023
88e7880
Update README.md
josemoracard Sep 6, 2023
01e8fda
Update README.es.md
josemoracard Sep 6, 2023
ffdb1c8
Update tests.js
josemoracard Sep 6, 2023
233aadb
Update README.md
josemoracard Sep 6, 2023
15691d1
Update README.md
josemoracard Sep 6, 2023
64b2ea7
Update README.md
josemoracard Sep 6, 2023
8b18167
Update README.es.md
josemoracard Sep 6, 2023
0f402f0
Update README.es.md
josemoracard Sep 6, 2023
0e1dd61
Update app.js
josemoracard Sep 6, 2023
d4533f5
Update solution.hide.js
josemoracard Sep 6, 2023
cd404b4
Update app.js
josemoracard Sep 6, 2023
72bd744
Update tests.js
josemoracard Sep 6, 2023
535e9a0
Update solution.hide.js
josemoracard Sep 6, 2023
7a25f8d
Update solution.hide.js
josemoracard Sep 6, 2023
c47bdbf
Update README.md
josemoracard Sep 6, 2023
68210bc
Update README.es.md
josemoracard Sep 6, 2023
be8ca27
Update app.js
josemoracard Sep 6, 2023
0892b6b
Update solution.hide.js
josemoracard Sep 6, 2023
5a45ca6
Update tests.js
josemoracard Sep 6, 2023
cda068e
Update README.md
josemoracard Sep 6, 2023
04b1eb7
Update README.es.md
josemoracard Sep 6, 2023
43a99e2
Update app.js
josemoracard Sep 6, 2023
44abb42
Update solution.hide.js
josemoracard Sep 6, 2023
8bb30a1
Update solution.hide.js
josemoracard Sep 6, 2023
352453e
Update solution.hide.js
josemoracard Sep 6, 2023
bff9275
Update solution.hide.js
josemoracard Sep 6, 2023
22cd0ca
Update README.md
josemoracard Sep 6, 2023
02f0fc6
Update README.es.md
josemoracard Sep 6, 2023
5b95fd9
Update app.js
josemoracard Sep 6, 2023
d03dec7
Update solution.hide.js
josemoracard Sep 6, 2023
ce21114
Update tests.js
josemoracard Sep 6, 2023
c45ccd6
Update app.js
josemoracard Sep 6, 2023
fe245e7
Update solution.hide.js
josemoracard Sep 6, 2023
ac77e1e
Update README.md
josemoracard Sep 6, 2023
14a0fd7
Update README.es.md
josemoracard Sep 6, 2023
27c79e3
Update app.js
josemoracard Sep 6, 2023
852cb69
Update solution.hide.js
josemoracard Sep 6, 2023
f8f400b
Update tests.js
josemoracard Sep 6, 2023
9c1b2e9
Update README.md
josemoracard Sep 6, 2023
8f70f44
Update README.es.md
josemoracard Sep 6, 2023
18c12b1
Update README.md
josemoracard Sep 6, 2023
2688169
Update app.js
josemoracard Sep 6, 2023
46a0ddc
Update tests.js
josemoracard Sep 6, 2023
c7ff5c3
Update README.md
josemoracard Sep 6, 2023
679f481
Update README.es.md
josemoracard Sep 6, 2023
a8898b5
Update solution.hide.js
josemoracard Sep 6, 2023
1bef426
Removed test that did the same as last one (line 26) to avoid confusion
josemoracard Sep 6, 2023
a6e70b0
Update README.md
josemoracard Sep 6, 2023
1cd7686
Update README.md
josemoracard Sep 6, 2023
b4a87bf
Update README.es.md
josemoracard Sep 6, 2023
7e8a130
Update app.js
josemoracard Sep 6, 2023
f572b69
Update solution.hide.js
josemoracard Sep 6, 2023
3451060
Update README.es.md
josemoracard Sep 6, 2023
0aa8e59
Update README.md
josemoracard Sep 6, 2023
14da688
Update README.md
josemoracard Sep 6, 2023
af07dd6
Update app.js
josemoracard Sep 6, 2023
6653448
Update tests.js
josemoracard Sep 6, 2023
189d57b
Update README.md
josemoracard Sep 6, 2023
62080f2
Update README.es.md
josemoracard Sep 6, 2023
f65c57d
Update README.md
josemoracard Sep 6, 2023
cbcee32
Update app.js
josemoracard Sep 6, 2023
2bc37b9
Update solution.hide.js
josemoracard Sep 6, 2023
1a94d11
Update tests.js
josemoracard Sep 6, 2023
52a2483
Update tests.js
josemoracard Sep 6, 2023
696ad3b
Update tests.js
josemoracard Sep 6, 2023
4680793
Update tests.js
josemoracard Sep 6, 2023
2390635
Update README.md
josemoracard Sep 6, 2023
776a76c
Update README.es.md
josemoracard Sep 6, 2023
22a782d
Update solution.hide.js
josemoracard Sep 6, 2023
d5621b2
Update solution.hide.js
josemoracard Sep 6, 2023
2542239
Update solution.hide.js
josemoracard Sep 6, 2023
74cee25
Update app.js
josemoracard Sep 6, 2023
9c10109
Update app.js
josemoracard Sep 6, 2023
655695d
Update README.md
josemoracard Sep 6, 2023
5544961
Update README.es.md
josemoracard Sep 6, 2023
b63d755
Update tests.js
josemoracard Sep 6, 2023
0ca7871
Update README.md
josemoracard Sep 6, 2023
9fe0c66
Update README.md
josemoracard Sep 6, 2023
124c963
Update README.es.md
josemoracard Sep 6, 2023
dc38847
Update app.js
josemoracard Sep 6, 2023
03173d8
Update solution.hide.js
josemoracard Sep 6, 2023
4207020
Update tests.js
josemoracard Sep 6, 2023
bb78770
Update README.md
josemoracard Sep 6, 2023
c32aba6
Update README.es.md
josemoracard Sep 6, 2023
8876cd5
Update README.es.md
josemoracard Sep 6, 2023
58a419c
Update README.md
josemoracard Sep 6, 2023
27df11d
Update README.es.md
josemoracard Sep 6, 2023
d04dbb7
Update README.md
josemoracard Sep 6, 2023
ec8ecfa
Update app.js
josemoracard Sep 6, 2023
73fa6e8
Update app.js
josemoracard Sep 6, 2023
0cafe37
Update solution.hide.js
josemoracard Sep 6, 2023
357d5c3
Update tests.js
josemoracard Sep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exercises/01-Hello_World/README.es.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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:

Expand Down
10 changes: 5 additions & 5 deletions exercises/01-Hello_World/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -18,8 +18,8 @@ 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:

+ 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
2 changes: 1 addition & 1 deletion exercises/01-Hello_World/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 10 additions & 10 deletions exercises/02.1-Access_and_retrieve/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -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** (Índice): 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.
13 changes: 7 additions & 6 deletions exercises/02.1-Access_and_retrieve/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ 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:

```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 (item).

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

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.

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

Expand Down
8 changes: 4 additions & 4 deletions exercises/02.1-Access_and_retrieve/app.js
Original file line number Diff line number Diff line change
@@ -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 3rd 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
// 3. print the position of step 2
14 changes: 7 additions & 7 deletions exercises/02.1-Access_and_retrieve/solution.hide.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//declaring the array
// 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'];


//1. print the item here
console.log(myArray[2])
// 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])
// 3. print the position of step 2
console.log(myArray[4]);
6 changes: 3 additions & 3 deletions exercises/02.1-Access_and_retrieve/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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);
});
});
8 changes: 4 additions & 4 deletions exercises/02.2-Retrieve_Items/README.es.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# `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:

```js
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.
2. Imprima en la consola el 4to elemento del array.
6 changes: 3 additions & 3 deletions exercises/02.2-Retrieve_Items/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.
2 changes: 1 addition & 1 deletion exercises/02.2-Retrieve_Items/app.js
Original file line number Diff line number Diff line change
@@ -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
// your code here
9 changes: 3 additions & 6 deletions exercises/02.2-Retrieve_Items/solution.hide.js
Original file line number Diff line number Diff line change
@@ -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]);
console.log(arr[3]);
4 changes: 2 additions & 2 deletions exercises/02.2-Retrieve_Items/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ 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);
});

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);
});
});
4 changes: 2 additions & 2 deletions exercises/03-Print_the_last_one/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
2. Luego, imprímelo en la consola.
6 changes: 3 additions & 3 deletions exercises/03-Print_the_last_one/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion exercises/03-Print_the_last_one/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ function generateRandomArray()
}
let myStupidArray = generateRandomArray();

//Your code here
// Your code here
4 changes: 2 additions & 2 deletions exercises/03-Print_the_last_one/solution.hide.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ 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();

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

8 changes: 4 additions & 4 deletions exercises/04.1-Loop_from_one_to_seventeen/README.es.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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).
8 changes: 4 additions & 4 deletions exercises/04.1-Loop_from_one_to_seventeen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).
+ Here is a [6 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
6 changes: 3 additions & 3 deletions exercises/04.1-Loop_from_one_to_seventeen/app.js
Original file line number Diff line number Diff line change
@@ -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
}
Loading