diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md index 2841fed32c..f94fd2302a 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.english.md @@ -26,7 +26,7 @@ const profileUpdate = ({ name, age, nationality, location }) => { ``` This removes some extra lines and makes our code look neat. -This has the added benefit of not having to manipulate an entire object in a function; only the fields that are needed are copied inside the function. +This has the added benefit of not having to manipulate an entire object in a function — only the fields that are needed are copied inside the function. ## Instructions diff --git a/curriculum/challenges/spanish/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.spanish.md b/curriculum/challenges/spanish/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.spanish.md index 6d205af297..c0cb0d0909 100644 --- a/curriculum/challenges/spanish/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.spanish.md +++ b/curriculum/challenges/spanish/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters.spanish.md @@ -7,7 +7,7 @@ localeTitle: Utilice la asignación de destrucción para pasar un objeto como pa --- ## Description -
En algunos casos, puede destruir el objeto en un argumento de función. Considere el siguiente código:
const profileUpdate = (profileData) => {
const {nombre, edad, nacionalidad, ubicación} = profileData;
// haz algo con estas variables
}
Esto destruye efectivamente el objeto enviado a la función. Esto también se puede hacer en el lugar:
const profileUpdate = ({nombre, edad, nacionalidad, ubicación}) => {
/ * hacer algo con estos campos * /
}
Esto elimina algunas líneas adicionales y hace que nuestro código se vea limpio. Esto tiene la ventaja adicional de no tener que manipular un objeto completo en una función; solo los campos que son necesarios se copian dentro de la función.
+
En algunos casos, puede destruir el objeto en un argumento de función. Considere el siguiente código:
const profileUpdate = (profileData) => {
const {nombre, edad, nacionalidad, ubicación} = profileData;
// haz algo con estas variables
}
Esto destruye efectivamente el objeto enviado a la función. Esto también se puede hacer en el lugar:
const profileUpdate = ({nombre, edad, nacionalidad, ubicación}) => {
/ * hacer algo con estos campos * /
}
Esto elimina algunas líneas adicionales y hace que nuestro código se vea limpio. Esto tiene la ventaja adicional de no tener que manipular un objeto completo en una función — solo los campos que son necesarios se copian dentro de la función.
## Instructions
Use la asignación de desestructuración dentro del argumento de la función half para enviar solo max y min dentro de la función.
diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters/index.md index f83d21c83a..e9c3bf29a1 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters/index.md @@ -6,7 +6,7 @@ title: Use Destructuring Assignment to Pass an Object as a Function's Parameters --- ## Problem Explanation -You could pass the entire object, and then pick the specific attributes you want by using the `.` operator. But ES6 offers a more elegant option! +You could pass the entire object and then pick the specific attributes you want by using the `.` operator, but ES6 offers a more elegant option! --- @@ -14,7 +14,7 @@ You could pass the entire object, and then pick the specific attributes you want ### Hint 1 -Get rid of the `stats`, and see if you can destructure it. We need the `max` and `min` of `stats`. +Get rid of the `stats` and see if you can destructure it. We need the `max` and `min` of `stats`.