Skip to content

ready til ex 21 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ebc9058
Update README.md
hexbreak Jan 22, 2021
1134db5
Update README.md
hexbreak Jan 22, 2021
8c3894c
Merge pull request #10 from 4GeeksAcademy/learnpack
ElviraQDP Feb 10, 2021
e6e30b7
Update .gitpod.Dockerfile
alesanchezr Feb 11, 2021
fb9734b
Add files via upload
ElviraQDP Feb 15, 2021
bd495b9
uploaded badge to README.md
ElviraQDP Feb 15, 2021
3bbfa43
Delete badge-loop.png
ElviraQDP Feb 15, 2021
0fac30c
image added
ElviraQDP Feb 15, 2021
bd7d8d4
image added
ElviraQDP Feb 15, 2021
34072a6
Delete badge-loop.png
ElviraQDP Feb 15, 2021
d19afae
badge added to readme.md
ElviraQDP Feb 15, 2021
342536d
Delete loop-badge.png
ElviraQDP Feb 15, 2021
e5b3b55
badge uploaded
ElviraQDP Feb 15, 2021
d207b94
cool icon uploaded
ElviraQDP Feb 15, 2021
3347deb
url updated
ElviraQDP Mar 13, 2021
58ba1f0
Update README.md
alesanchezr Apr 1, 2021
3477f43
Merge branch 'master' into patch-2
alesanchezr May 28, 2021
e5a6044
Merge pull request #6 from hexbreak/patch-2
alesanchezr May 28, 2021
337fc77
error on the code
wotanCode Jun 14, 2021
6c3e7da
Issue #201 fixed
tommygonzaleza Jun 16, 2021
cc4ff43
Issue #191 solved
tommygonzaleza Jun 16, 2021
d77d78d
Merge pull request #13 from tommygonzaleza/master
alesanchezr Jun 16, 2021
564fd40
Issue #151 fixed, test improved and README.md example changed
tommygonzaleza Jun 18, 2021
dd81a89
Merge pull request #14 from tommygonzaleza/master
alesanchezr Jun 18, 2021
31db0f0
Small issue on the exercise fixed.
tommygonzaleza Jun 19, 2021
efe6b98
Update test.js
alesanchezr Jun 25, 2021
7fe34bf
Two Parts
GMDEEP Jul 3, 2021
54dd6bc
Typo
GMDEEP Jul 3, 2021
ba35ed2
Issue #266 fixed
tommygonzaleza Jul 6, 2021
3309a15
Merge pull request #15 from tommygonzaleza/master
alesanchezr Jul 8, 2021
a7e40c1
Merge branch 'master' into patch-1
alesanchezr Jul 8, 2021
62876ab
Merge pull request #12 from wotanCode/patch-1
alesanchezr Jul 8, 2021
8c9b9e1
Merge pull request #19 from GMDEEP/patch-4
alesanchezr Jul 8, 2021
3fdf099
Merge pull request #18 from GMDEEP/patch-3
alesanchezr Jul 8, 2021
a6f0bbc
Update README.md
alesanchezr Jul 8, 2021
325e31a
reviewing instructions til 8.2
ElviraQDP Jul 13, 2021
7689428
reviewing instructions til ex 18
ElviraQDP Jul 13, 2021
f1dcd7e
ready til ex 18
ElviraQDP Jul 13, 2021
79633a9
reviewing instructions until es 21
ElviraQDP Jul 15, 2021
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
2 changes: 1 addition & 1 deletion .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ FROM gitpod/workspace-full:latest
USER gitpod

RUN npm i jest@24.8.0 -g
RUN npm i learnpack -g && learnpack plugins:install learnpack-node@0.0.13
RUN npm i learnpack@0.0.88 -g && learnpack plugins:install learnpack-node@0.0.17
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Looping in Javascript Tutorial & Exercises

<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>
<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>

> 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/)

![last commit](https://img.shields.io/github/last-commit/4geeksacademy/javascript-arrays-exercises-tutorial)
[![build by developers](https://img.shields.io/badge/build_by-Developers-blue)](https://breatheco.de)
[![build by developers](https://img.shields.io/twitter/follow/4geeksacademy?style=social&logo=twitter)](https://twitter.com/4geeksacademy)


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!

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

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.

<p align="center">
<img src="https://raw.githubusercontent.com/4GeeksAcademy/react-exercises/master/preview.gif">
</p>
Expand Down
Binary file added badge-loop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions exercises/01-Welcome/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ intro: https://www.youtube.com/watch?v=ooHdelGf0gI

# Bienvenido a los Loops

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:
Practicaremos los bucles o loops en javascript hasta que te sientas cómodo con ellos.

Te recomendamos ver el siguiente ![video sbre loops o bucles](https://www.youtube.com/watch?v=U3ZlQSOcOI0) antes de empezar. Nos centraremos en:

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

Haga click en `next →` cuando se encuentre listo para iniciar los ejercicios.
Haga click en `next →` cuando estés listo para iniciar los ejercicios.


***
Si necesitas ir a un ejercicio en particular puedes seleccionar en el menu superior.
<p align="center">
<img src="./menu.png">
</p>
Y seleccionar el curso
Y seleccionar el ejercicio
<p align="center">
<img src="./menu2.png">
</p>
14 changes: 13 additions & 1 deletion exercises/01-Welcome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ intro: https://www.youtube.com/watch?v=ooHdelGf0gI

# Welcome to Loops

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:
Practice loops in javascript until you become confortable with it.

We recomend you watching [this short video about loops](https://www.youtube.com/watch?v=U3ZlQSOcOI0) before starting. We will focus on:

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

Click `next →` when you are ready to start the exercises.

***
If you need to go to a specific exercise you may select the top menu
<p align="center">
<img src="./menu.png">
</p>
And select the exercise
<p align="center">
<img src="./menu2.png">
</p>
9 changes: 6 additions & 3 deletions exercises/02-Hello-World/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

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

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

Este es un ejemplo de cómo usarlo:

```js
console.log("How are you?");
```

## 📝 Instrucciones:

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

## 💡 Información Adicional:
## 💡 Pista:

Video de 5 minutos sobre la consola:
https://www.youtube.com/watch?v=1RlkftxAo-M
7 changes: 5 additions & 2 deletions exercises/02-Hello-World/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ tutorial: https://www.youtube.com/watch?v=miBzmGgMIbU

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

This is an example of how to use it:

```js
console.log("How are you?");
```

## 📝 Instructions:

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:

Expand Down
27 changes: 18 additions & 9 deletions exercises/03.1-Access-and-retrieve/README.es.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
# `03.1` Access and Retrive

Las matrices (arreglos) son parte de cada lenguaje de programación. Son el camino a seguir cuando desea tener una "lista de elementos".
Los arrays (arreglos) son parte de todo lenguaje de programación. Son el camino a seguir cuando quieres tener una "lista de elementos".

Por ejemplo, podríamos tener un arreglo (array) que almacena los días de la semana:

Por ejemplo, podríamos tener un arreglo que almacena los días de la semana:
```js
var myArray = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'];
```
Cada arreglo tiene las siguientes partes:
- Items: son los valores reales dentro de cada posición del arreglo.

- Items: son los valores reales dentro de cada posición del arreglo (array).

- Length (Longitud): es el tamaño del arreglo, el número de elementos.

- Index (indice): es la posición de un elemento.

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

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)!
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.

**IMPORTANTE: ¡Cada arreglo comienza desde cero (0)!**

# 📝 Instrucciones

1. Usando la función `console.log`, imprima el tercer elemento del arreglo.
2. Cambia el valor en la posición donde se encuentra `jueves` a nulo.
1. Usando la función `console.log`, imprime el tercer elemento del arreglo.

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

3. Imprime esa posición en particular.

```txt
⚠️ Nota Importante: Use null como valor y no "null" como un string.
```

### :bulb: Pista:

Usa null como valor y no "null" como un string.
20 changes: 14 additions & 6 deletions exercises/03.1-Access-and-retrieve/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,33 @@ tutorial: https://www.youtube.com/watch?v=9-yAzjsWXtU

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 is storing the days of the week:
For example, we could have an array that stores the days of the week:

```js
var 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.

- Length: is the size of the array, the number of items.

- Index: is the position of an element.

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

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)!
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.
**IMPORTANT: Every array starts from cero (0)!**

# 📝 Instructions

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.

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

3. Print that particular position.

```txt
⚠️ Important note: Use null as a value and not "null" as a string.
```
### :bulb: Hint:

Use null as a value and not "null" as a string.

10 changes: 6 additions & 4 deletions exercises/03.2-Retrieve-Items/README.es.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# `03.2` Retrieve Items

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

Debes envolver el índice entre corchetes de esta manera:

Necesita envolver el índice entre corchetes de esta manera:
```js
var myValue = array[index];
```

# 📝 Instrucciones

1. Imprima en la consola el 1er elemento de la matriz
2. Imprima en la consola el 4to elemento de la matriz
1. Imprima en la consola el 1er elemento de array o arreglo.

2. Imprima en la consola el 4to elemento de la arreglo o array.
4 changes: 3 additions & 1 deletion exercises/03.2-Retrieve-Items/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ tutorial: https://www.youtube.com/watch?v=rWYIgofIAME

# `03.2` Retrieve Items

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

You need to wrap the index into brackets like this:

```js
var myValue = array[index];
```

# 📝 Instructions

1. Print on the console the 1st element of the array

2. Print on the console the 4th element of the array
15 changes: 15 additions & 0 deletions exercises/04-Print-the-last-one/README.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `04.1` Print the last one

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

```js
var totalItems = myStupidArray.length;
```

## 📝 Instrucciones:

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

2. Luego, imprímelo en la consola.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +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 ont he console).
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).

```js
var totalItems = myStupidArray.length;
```

# 📝 Instructions

1. Create a variable named theLastOne, and assign it the LAST element of myStupidArray.
1. Create a variable named `theLastOne`, and assign it the LAST element of `myStupidArray`.

2. Then, print it on the console.
14 changes: 0 additions & 14 deletions exercises/04.1-Print-the-last-one/README.es.md

This file was deleted.

15 changes: 11 additions & 4 deletions exercises/05.1-Loop-from-one-to-seventeen/README.es.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# `05.1` Loop from one to seventeen
# `05.1` Loop del uno al diecisiete

El loop (bucle) actual se repite de cero a diez, por favor, haga un loop de 1 a 17.
El loop (bucle) actual se repite del cero a diez,

## 📝 Instrucciones:

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

### Resultado esperado:

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

## 💡Pista:

1. Tienes que recorrer del 1 al 17 (no del 0 al 17).
2. Aquí esta un [video de 2 min explicando como hacer un loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
+ 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).



13 changes: 9 additions & 4 deletions exercises/05.1-Loop-from-one-to-seventeen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ tutorial: https://www.youtube.com/watch?v=4QGaROXZ3oc

# `05.1` Loop from one to seventeen

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

Expected console result:
## 📝 Instructions

1. Please make it loop from 1 to 17.

### Expected result:

```bash
1
Expand All @@ -30,8 +34,9 @@ Expected console result:

## 💡Hint:

1. You have to loop from 1 to 17 (not from 0 to 17).
2. Here is a [2 minute video explaining how to loop](https://www.youtube.com/watch?v=s9wW2PpJsmQ).
+ 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).



8 changes: 6 additions & 2 deletions exercises/05.2-Loop-from-seven-to-twelve/README.es.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# `05.2` Loop from seven to twelve
# `05.2` Loop del siete al doce

Cuenta del 7 al 12 con un loop e imprima cada número en la consola.
## 📝 Instrucciones:

1. Cuenta del 7 al 12 con un loop e imprime cada número en la consola.

## Resultado esperado:

```bash
7
Expand Down
6 changes: 5 additions & 1 deletion exercises/05.2-Loop-from-seven-to-twelve/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ tutorial: https://www.youtube.com/watch?v=6eLXV_IL2m0

# `05.2` Loop from seven to twelve

Count from 7 to 12 with a loop and print each number on the console.
## 📝 Instructions:

1. Count from 7 to 12 with a loop and print each number on the console.

## Expected result:

```bash
7
Expand Down
Loading