Skip to content

Commit 5c36476

Browse files
authored
Merge pull request #24 from ElviraQDP/master
ready til ex 21
2 parents 1ba5fab + 79633a9 commit 5c36476

File tree

98 files changed

+884
-610
lines changed

Some content is hidden

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

98 files changed

+884
-610
lines changed

.gitpod.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ FROM gitpod/workspace-full:latest
33
USER gitpod
44

55
RUN npm i [email protected] -g
6-
RUN npm i learnpack -g && learnpack plugins:install [email protected].13
6+
RUN npm i learnpack@0.0.88 -g && learnpack plugins:install [email protected].17

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Looping in Javascript Tutorial & Exercises
22

3-
<a href="https://www.4geeksacademy.co"><img height="280" align="right" src="https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial/blob/master/.breathecode/assets/badge.png?raw=true"></a>
3+
<a href="https://www.4geeksacademy.co"><img height="280" align="right" src="https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial/blob/master/badge-loop.png"></a>
44

55
> By [@alesanchezr](https://twitter.com/alesanchezr) and [other contributors](https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial/graphs/contributors) at [4Geeks Academy](https://4geeksacademy.co/)
66
77
![last commit](https://img.shields.io/github/last-commit/4geeksacademy/javascript-arrays-exercises-tutorial)
88
[![build by developers](https://img.shields.io/badge/build_by-Developers-blue)](https://breatheco.de)
99
[![build by developers](https://img.shields.io/twitter/follow/4geeksacademy?style=social&logo=twitter)](https://twitter.com/4geeksacademy)
1010

11+
1112
Dozens of looping exercises to sharpen your looping skills with for, forEach, map, filter, looping a dictionary, looping bidimentional arrays, adding conditions to loops, finding an element, and more!
1213

1314
1. [Javascript for Beginners](https://github.com/4GeeksAcademy/javascript-beginner-exercises-tutorial)
14-
2. [Looping with Javascript](https://github.com/4GeeksAcademy/javascript-beginner-exercises-tutorial) ← your are here now 🔥
15+
2. [Looping with Javascript](https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial) ← your are here now 🔥
1516
3. [Javascript Functions](https://github.com/4GeeksAcademy/javascript-functions-exercises-tutorial)
1617

18+
We need you! These exercises are built and maintained in collaboration with contributors such as yourself. If you find any bugs or misspellings please contribute and/or report them.
19+
1720
<p align="center">
1821
<img src="https://raw.githubusercontent.com/4GeeksAcademy/react-exercises/master/preview.gif">
1922
</p>

badge-loop.png

36.7 KB
Loading

exercises/01-Welcome/README.es.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ intro: https://www.youtube.com/watch?v=ooHdelGf0gI
55

66
# Bienvenido a los Loops
77

8-
Practicaremos los bucles en javascript para se sienta cómodo con ellos. Recomendamos ver el siguiente video [Breve video sobre bucles](https://www.youtube.com/watch?v=U3ZlQSOcOI0) before starting:
8+
Practicaremos los bucles o loops en javascript hasta que te sientas cómodo con ellos.
9+
10+
Te recomendamos ver el siguiente ![video sbre loops o bucles](https://www.youtube.com/watch?v=U3ZlQSOcOI0) antes de empezar. Nos centraremos en:
911

1012
1. For loop.
1113
2. forEach.
@@ -15,15 +17,15 @@ Practicaremos los bucles en javascript para se sienta cómodo con ellos. Recome
1517
6. find.
1618
7. Diccionario de bucles (objetos literales).
1719

18-
Haga click en `next →` cuando se encuentre listo para iniciar los ejercicios.
20+
Haga click en `next →` cuando estés listo para iniciar los ejercicios.
1921

2022

2123
***
2224
Si necesitas ir a un ejercicio en particular puedes seleccionar en el menu superior.
2325
<p align="center">
2426
<img src="./menu.png">
2527
</p>
26-
Y seleccionar el curso
28+
Y seleccionar el ejercicio
2729
<p align="center">
2830
<img src="./menu2.png">
2931
</p>

exercises/01-Welcome/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ intro: https://www.youtube.com/watch?v=ooHdelGf0gI
55

66
# Welcome to Loops
77

8-
Practice loops in javascript until you become confortable with it, I recomend watching [this short video about loops](https://www.youtube.com/watch?v=U3ZlQSOcOI0) before starting:
8+
Practice loops in javascript until you become confortable with it.
9+
10+
We recomend you watching [this short video about loops](https://www.youtube.com/watch?v=U3ZlQSOcOI0) before starting. We will focus on:
911

1012
1. For loop.
1113
2. forEach.
@@ -16,3 +18,13 @@ Practice loops in javascript until you become confortable with it, I recomend wa
1618
7. Loop dictionaries (object literals).
1719

1820
Click `next →` when you are ready to start the exercises.
21+
22+
***
23+
If you need to go to a specific exercise you may select the top menu
24+
<p align="center">
25+
<img src="./menu.png">
26+
</p>
27+
And select the exercise
28+
<p align="center">
29+
<img src="./menu2.png">
30+
</p>

exercises/02-Hello-World/README.es.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22

33
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`.
44

5-
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.
5+
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).
6+
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.
68

79
Este es un ejemplo de cómo usarlo:
10+
811
```js
912
console.log("How are you?");
1013
```
1114

1215
## 📝 Instrucciones:
1316

14-
Use console.log para imprimir "Hello World" en la consola. Siéntase libre de probar otras cosas también.
17+
1. Usa `console.log` para imprimir "Hello World" en la consola. Sientete libre de probar otras cosas también.
1518

16-
## 💡 Información Adicional:
19+
## 💡 Pista:
1720

1821
Video de 5 minutos sobre la consola:
1922
https://www.youtube.com/watch?v=1RlkftxAo-M

exercises/02-Hello-World/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ tutorial: https://www.youtube.com/watch?v=miBzmGgMIbU
66

77
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). 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.
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).
10+
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.
1012

1113
This is an example of how to use it:
14+
1215
```js
1316
console.log("How are you?");
1417
```
1518

1619
## 📝 Instructions:
1720

18-
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.
1922

2023
## 💡 Hint:
2124

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
# `03.1` Access and Retrive
22

3-
Las matrices (arreglos) son parte de cada lenguaje de programación. Son el camino a seguir cuando desea tener una "lista de elementos".
3+
Los arrays (arreglos) son parte de todo lenguaje de programación. Son el camino a seguir cuando quieres tener una "lista de elementos".
4+
5+
Por ejemplo, podríamos tener un arreglo (array) que almacena los días de la semana:
46

5-
Por ejemplo, podríamos tener un arreglo que almacena los días de la semana:
67
```js
78
var myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
89
```
910
Cada arreglo tiene las siguientes partes:
10-
- Items: son los valores reales dentro de cada posición del arreglo.
11+
12+
- Items: son los valores reales dentro de cada posición del arreglo (array).
13+
1114
- Length (Longitud): es el tamaño del arreglo, el número de elementos.
15+
1216
- Index (indice): es la posición de un elemento.
1317

1418
![Como funciona un arreglo](https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial/blob/5e6a9b1276ed2b7de1b9bb0240105983c170611c/.learn/assets/DbmSOHT.png?raw=true)
1519

16-
Para acceder a cualquier elemento en particular dentro del arreglo, necesitas conocer su índice (posición). El índice es un valor entero que representa la posición en la que se encuentra el elemento. Acotación: ¡Cada arreglo comienza desde cero (0)!
20+
Para acceder a cualquier elemento en particular dentro del arreglo (array) debes conocer su índice (posición. El índice es un valor entero que representa la posición en la que se encuentra el elemento.
21+
22+
**IMPORTANTE: ¡Cada arreglo comienza desde cero (0)!**
1723

1824
# 📝 Instrucciones
1925

20-
1. Usando la función `console.log`, imprima el tercer elemento del arreglo.
21-
2. Cambia el valor en la posición donde se encuentra `jueves` a nulo.
26+
1. Usando la función `console.log`, imprime el tercer elemento del arreglo.
27+
28+
2. Cambia el valor en la posición donde se encuentra `jueves` a `null`(nulo).
29+
2230
3. Imprime esa posición en particular.
2331

24-
```txt
25-
⚠️ Nota Importante: Use null como valor y no "null" como un string.
26-
```
32+
33+
### :bulb: Pista:
34+
35+
Usa null como valor y no "null" como un string.

exercises/03.1-Access-and-retrieve/README.md

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

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

9-
For example, we could have an array that is storing the days of the week:
9+
For example, we could have an array that stores the days of the week:
10+
1011
```js
1112
var myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
1213
```
1314
Every array has the following parts:
15+
1416
- Items: are the actual values inside on each position of the array.
17+
1518
- Length: is the size of the array, the number of items.
19+
1620
- Index: is the position of an element.
1721

1822
![How arrays work](https://github.com/4GeeksAcademy/javascript-arrays-exercises-tutorial/blob/5e6a9b1276ed2b7de1b9bb0240105983c170611c/.learn/assets/DbmSOHT.png?raw=true)
1923

20-
To access any particular 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. Protip: Every array starts from cero (0)!
24+
To access any particular 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.
25+
**IMPORTANT: Every array starts from cero (0)!**
2126

2227
# 📝 Instructions
2328

2429
1. Using the `console.log` function, print the 3rd item from the array.
25-
2. Change the value in the position where `thursday` is located to null.
30+
31+
2. Change the value in the position where `thursday` is located to `null`.
32+
2633
3. Print that particular position.
2734

28-
```txt
29-
⚠️ Important note: Use null as a value and not "null" as a string.
30-
```
35+
### :bulb: Hint:
36+
37+
Use null as a value and not "null" as a string.
38+
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# `03.2` Retrieve Items
22

3-
La única forma de acceder a un elemento particular en un arreglo es usando un índice. Un índice 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 un índice. Un índice es un `número` entero que representa la posición a la que desea acceder en el arreglo.
4+
5+
Debes envolver el índice entre corchetes de esta manera:
46

5-
Necesita envolver el índice entre corchetes de esta manera:
67
```js
78
var myValue = array[index];
89
```
910

1011
# 📝 Instrucciones
1112

12-
1. Imprima en la consola el 1er elemento de la matriz
13-
2. Imprima en la consola el 4to elemento de la matriz
13+
1. Imprima en la consola el 1er elemento de array o arreglo.
14+
15+
2. Imprima en la consola el 4to elemento de la arreglo o array.

exercises/03.2-Retrieve-Items/README.md

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

55
# `03.2` Retrieve Items
66

7-
The only way of accessing a particular element in an array is 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 an index. An 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:
10+
1011
```js
1112
var myValue = array[index];
1213
```
1314

1415
# 📝 Instructions
1516

1617
1. Print on the console the 1st element of the array
18+
1719
2. Print on the console the 4th element of the array
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# `04.1` Print the last one
2+
3+
Nunca sabrás cuántos elementos tiene `myStupidArray` porque se genera aleatoriamente durante el tiempo de ejecución utilizando la función `generateRandomArray`.
4+
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).
6+
7+
```js
8+
var totalItems = myStupidArray.length;
9+
```
10+
11+
## 📝 Instrucciones:
12+
13+
1. Crea una variable llamada `theLastOne` y asígnale el último elemento de `myStupidArray`.
14+
15+
2. Luego, imprímelo en la consola.

exercises/04.1-Print-the-last-one/README.md renamed to exercises/04-Print-the-last-one/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +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 ont he console).
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).
1010

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

1515
# 📝 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 it the LAST element of `myStupidArray`.
18+
1819
2. Then, print it on the console.

exercises/04.1-Print-the-last-one/README.es.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

exercises/05.1-Loop-from-one-to-seventeen/README.es.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# `05.1` Loop from one to seventeen
1+
# `05.1` Loop del uno al diecisiete
22

3-
El loop (bucle) actual se repite de cero a diez, por favor, haga un loop de 1 a 17.
3+
El loop (bucle) actual se repite del cero a diez,
4+
5+
## 📝 Instrucciones:
6+
7+
1. Por favor, haz un loop de 1 a 17.
8+
9+
### Resultado esperado:
410

511
```bash
612
1
@@ -24,8 +30,9 @@ El loop (bucle) actual se repite de cero a diez, por favor, haga un loop de 1 a
2430

2531
## 💡Pista:
2632

27-
1. Tienes que recorrer del 1 al 17 (no del 0 al 17).
28-
2. Aquí esta un [video de 2 min explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
33+
+ Tienes que recorrer del 1 al 17 (no del 0 al 17).
34+
35+
+ Aquí esta un [video de 2 min explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
2936

3037

3138

exercises/05.1-Loop-from-one-to-seventeen/README.md

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

55
# `05.1` Loop from one to seventeen
66

7-
The current loop is looping from zero to ten, please make it loop from 1 to 17.
7+
The current loop is looping from zero to ten,
88

9-
Expected console result:
9+
## 📝 Instructions
10+
11+
1. Please make it loop from 1 to 17.
12+
13+
### Expected result:
1014

1115
```bash
1216
1
@@ -30,8 +34,9 @@ Expected console result:
3034

3135
## 💡Hint:
3236

33-
1. You have to loop from 1 to 17 (not from 0 to 17).
34-
2. Here is a [2 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
37+
+ You have to loop from 1 to 17 (not from 0 to 17).
38+
39+
+ Here is a [2 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
3540

3641

3742

exercises/05.2-Loop-from-seven-to-twelve/README.es.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# `05.2` Loop from seven to twelve
1+
# `05.2` Loop del siete al doce
22

3-
Cuenta del 7 al 12 con un loop e imprima cada número en la consola.
3+
## 📝 Instrucciones:
4+
5+
1. Cuenta del 7 al 12 con un loop e imprime cada número en la consola.
6+
7+
## Resultado esperado:
48

59
```bash
610
7

exercises/05.2-Loop-from-seven-to-twelve/README.md

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

55
# `05.2` Loop from seven to twelve
66

7-
Count from 7 to 12 with a loop and print each number on the console.
7+
## 📝 Instructions:
8+
9+
1. Count from 7 to 12 with a loop and print each number on the console.
10+
11+
## Expected result:
812

913
```bash
1014
7

0 commit comments

Comments
 (0)