mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-04 09:05:49 -05:00
chore(i18n,learn): processed translations (#49879)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56bbb991ad1ed5201cd392ce
|
||||
title: Manipulate Arrays With unshift Method
|
||||
title: Manipular arreglos con el método unshift
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/ckNDESv'
|
||||
forumTopicId: 18239
|
||||
|
||||
@@ -8,21 +8,28 @@ dashedName: record-collection
|
||||
|
||||
# --description--
|
||||
|
||||
Se te da un objeto literal que representa una parte de tu colección de álbumes musicales. Cada álbum tiene un número de id único como clave y varias otras propiedades. No todos los álbumes tienen una información completa.
|
||||
You are creating a function that aids in the maintenance of a musical album collection. The collection is organized as an object that contains multiple albums which are also objects. Each album is represented in the collection with a unique `id` as the property name. Within each album object, there are various properties describing information about the album. Not all albums have complete information.
|
||||
|
||||
Empiezas con una función `updateRecords` la cual toma un objeto literal, `records`, que contiene el álbum musical de la colección, un `id`, `prop` (como `artist` o `tracks`), y `value`. Completa la función usando las reglas siguientes para modificar el objeto pasado a la función.
|
||||
The `updateRecords` function takes 4 arguments represented by the following function parameters:
|
||||
|
||||
- Tu función siempre debe devolver el objeto de colección de registros completo.
|
||||
- Si `prop` no es `tracks` y `value` no es una cadena vacía, actualiza o establece la propiedad `prop` del album a `value`.
|
||||
- Si `prop` es `tracks` pero el álbum no tiene una propiedad `tracks`, crea un arreglo vacío y agrégale `value` a él.
|
||||
- Si `prop` es `tracks` y `value` no es una cadena vacía, agrega `value` al final del arreglo de `tracks` existentes del álbum.
|
||||
- Si `value` es una cadena vacía, elimina esa propiedad `prop` del álbum.
|
||||
- `records` - an object containing several individual albums
|
||||
- `id` - a number representing a specific album in the `records` object
|
||||
- `prop` - a string representing the name of the album’s property to update
|
||||
- `value` - a string containing the information used to update the album’s property
|
||||
|
||||
**Nota:** Se usa una copia del objeto `recordCollection` para las pruebas.
|
||||
Complete the function using the rules below to modify the object passed to the function.
|
||||
|
||||
- Your function must always return the entire `records` object.
|
||||
- If `value` is an empty string, delete the given `prop` property from the album.
|
||||
- If `prop` isn’t `"tracks"` and `value` isn't an empty string, assign the `value` to that album’s `prop`.
|
||||
- If `prop` is `"tracks"` and `value` isn’t an empty string, add the `value` to the end of the album’s existing `"tracks"` array.
|
||||
- If the album doesn’t have a `"tracks"` property, create a new array for the album's `"tracks"` property before adding the `value` to it.
|
||||
|
||||
**Note:** A copy of the `recordCollection` object is used for the tests. You should not directly modify the `recordCollection` object.
|
||||
|
||||
# --hints--
|
||||
|
||||
Después `updateRecords(recordCollection, 5439, "artist", "ABBA")`, `artist` debe ser la cadena `ABBA`
|
||||
After `updateRecords(recordCollection, 5439, "artist", "ABBA")`, `artist` should be the string `ABBA`
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -31,7 +38,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
Después `updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")`, `tracks` debe de tener la cadena `Take a Chance on Me` como el último y único elemento.
|
||||
After `updateRecords(recordCollection, 5439, "tracks", "Take a Chance on Me")`, `tracks` should have the string `Take a Chance on Me` as the last and only element.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -41,14 +48,14 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
Después de `updateRecords(recordCollection, 2548, "artist", "")`, `artist` no se debe establecido
|
||||
After `updateRecords(recordCollection, 2548, "artist", "")`, `artist` should not be set
|
||||
|
||||
```js
|
||||
updateRecords(_recordCollection, 2548, 'artist', '');
|
||||
assert(!_recordCollection[2548].hasOwnProperty('artist'));
|
||||
```
|
||||
|
||||
Después de `updateRecords(recordCollection, 1245, "tracks", "Addicted to Love")`, `tracks` debe tener la cadena `Addicted to Love` como último elemento.
|
||||
After `updateRecords(recordCollection, 1245, "tracks", "Addicted to Love")`, `tracks` should have the string `Addicted to Love` as the last element.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -58,7 +65,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
Después `updateRecords(recordCollection, 2468, "tracks", "Free")`, `tracks` debe tener la cadena `1999` como el primer elemento.
|
||||
After `updateRecords(recordCollection, 2468, "tracks", "Free")`, `tracks` should have the string `1999` as the first element.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -68,14 +75,14 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
Después `updateRecords(recordCollection, 2548, "tracks", "")`, `tracks` no se debe establecido
|
||||
After `updateRecords(recordCollection, 2548, "tracks", "")`, `tracks` should not be set
|
||||
|
||||
```js
|
||||
updateRecords(_recordCollection, 2548, 'tracks', '');
|
||||
assert(!_recordCollection[2548].hasOwnProperty('tracks'));
|
||||
```
|
||||
|
||||
Después de `updateRecords(recordCollection, 1245, "albumTitle", "Riptide")`, `albumTitle` debe ser la cadena `Riptide`
|
||||
After `updateRecords(recordCollection, 1245, "albumTitle", "Riptide")`, `albumTitle` should be the string `Riptide`
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
||||
@@ -15,7 +15,7 @@ Otro tipo de datos es el <dfn>Booleano</dfn>. Los booleanos solo pueden ser uno
|
||||
|
||||
# --instructions--
|
||||
|
||||
Modify the `welcomeToBooleans` function so that it returns `true` instead of `false`.
|
||||
Modifica la función `welcomeToBooleans` para que devuelva `true` en lugar de `false`.
|
||||
|
||||
# --hints--
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ dashedName: word-blanks
|
||||
|
||||
Se te proporcionan oraciones con algunas palabras faltantes, como sustantivos, verbos, adjetivos y adverbios. Luego, completa las piezas que faltan con palabras de tu elección de una manera que la oración completa tenga sentido.
|
||||
|
||||
Consider this sentence:
|
||||
Considera esta frase:
|
||||
|
||||
```md
|
||||
It was really ____, and we ____ ourselves ____.
|
||||
```
|
||||
|
||||
This sentence has three missing pieces- an adjective, a verb and an adverb, and we can add words of our choice to complete it. We can then assign the completed sentence to a variable as follows:
|
||||
A esta frase le faltan tres piezas: un adjetivo, un verbo y un adverbio, y podemos añadir las palabras que queramos para completarla. A continuación, podemos asignar la frase completa a una variable de la siguiente manera:
|
||||
|
||||
```js
|
||||
const sentence = "It was really " + "hot" + ", and we " + "laughed" + " ourselves " + "silly" + ".";
|
||||
@@ -25,21 +25,21 @@ const sentence = "It was really " + "hot" + ", and we " + "laughed" + " ourselve
|
||||
|
||||
# --instructions--
|
||||
|
||||
In this challenge, we provide you with a noun, a verb, an adjective and an adverb. You need to form a complete sentence using words of your choice, along with the words we provide.
|
||||
En este reto, te proporcionamos un sustantivo, un verbo, un adjetivo y un adverbio. Tienes que formar una frase completa utilizando palabras de tu elección, junto con las palabras que te proporcionamos.
|
||||
|
||||
You will need to use the string concatenation operator `+` to build a new string, using the provided variables: `myNoun`, `myAdjective`, `myVerb`, and `myAdverb`. You will then assign the formed string to the `wordBlanks` variable. You should not change the words assigned to the variables.
|
||||
Debes utilizar el operador de concatenación de cadenas `+` para construir una nueva cadena, utilizando las variables proporcionadas: `myNoun`, `myAdjective`, `myVerb`, y `myAdverb`. A continuación, asigna la cadena formada a la variable `wordBlanks`. No debes cambiar las palabras asignadas a las variables.
|
||||
|
||||
You will also need to account for spaces in your string, so that the final sentence has spaces between all the words. The result should be a complete sentence.
|
||||
También tendrás que tener en cuenta los espacios en tu cadena, de modo que la frase final tenga espacios entre todas las palabras. El resultado debe ser una frase completa.
|
||||
|
||||
# --hints--
|
||||
|
||||
`wordBlanks` should be a string.
|
||||
`wordBlanks` debe ser una cadena.
|
||||
|
||||
```js
|
||||
assert(typeof wordBlanks === 'string');
|
||||
```
|
||||
|
||||
You should not change the values assigned to `myNoun`, `myVerb`, `myAdjective` or `myAdverb`.
|
||||
No debes cambiar los valores asignados a `myNoun`, `myVerb`, `myAdjective` o `myAdverb`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@@ -50,7 +50,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
You should not directly use the values `dog`, `ran`, `big`, or `quickly` to create `wordBlanks`.
|
||||
No debes utilizar directamente los valores `dog`, `ran`, `big` o `quickly` para crear `wordBlanks`.
|
||||
|
||||
```js
|
||||
const newCode = removeAssignments(code);
|
||||
@@ -62,7 +62,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`wordBlanks` should contain all of the words assigned to the variables `myNoun`, `myVerb`, `myAdjective` and `myAdverb` separated by non-word characters (and any additional words of your choice).
|
||||
`wordBlanks` debes contener todas las palabras asignadas a las variables `myNoun`, `myVerb`, `myAdjective` y `myAdverb` separadas por caracteres no-palabra (y cualquier palabra adicional de su elección).
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
||||
Reference in New Issue
Block a user