From 2d15e768ff76e6425b983262199ce088e8744de8 Mon Sep 17 00:00:00 2001 From: Roy Gavrielov <38550146+roygav@users.noreply.github.com> Date: Tue, 20 Dec 2022 13:22:36 +0200 Subject: [PATCH] fix(curriculum): Update title and text of rest elements challenge (#48793) Update title and text of rest elements challenge --- ...t-with-the-rest-parameter-to-reassign-array-elements.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md index a73d64685c0..520e4297f7c 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-parameter-to-reassign-array-elements.md @@ -1,8 +1,7 @@ --- id: 587d7b8a367417b2b2512b4c title: >- - Use Destructuring Assignment with the Rest Parameter to Reassign Array - Elements + Destructuring via rest elements challengeType: 1 forumTopicId: 301218 dashedName: >- @@ -23,11 +22,11 @@ console.log(arr); The console would display the values `1, 2` and `[3, 4, 5, 7]`. -Variables `a` and `b` take the first and second values from the array. After that, because of the rest parameter's presence, `arr` gets the rest of the values in the form of an array. The rest element only works correctly as the last variable in the list. As in, you cannot use the rest parameter to catch a subarray that leaves out the last element of the original array. +Variables `a` and `b` take the first and second values from the array. After that, because of the rest syntax presence, `arr` gets the rest of the values in the form of an array. The rest element only works correctly as the last variable in the list. As in, you cannot use the rest syntax to catch a subarray that leaves out the last element of the original array. # --instructions-- -Use a destructuring assignment with the rest parameter to emulate the behavior of `Array.prototype.slice()`. `removeFirstTwo()` should return a sub-array of the original array `list` with the first two elements omitted. +Use a destructuring assignment with the rest syntax to emulate the behavior of `Array.prototype.slice()`. `removeFirstTwo()` should return a sub-array of the original array `list` with the first two elements omitted. # --hints--