Change "rest operator" to say "rest parameter" in challenges and guide (#35496)
* change es6 challenges rest operator to param * fix rest parameter typos * change rest operator to parameter in guide * fix casing * change rest operator to rest parameter in guide * change rest operator to rest parameter in curriculum * remove extra whitespace * remove whitespaces * remove whitespace * fix: removed arabic file * fix: removed chinese file
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
---
|
||||
title: Use Destructuring Assignment with the Rest Operator to Reassign Array Elements
|
||||
title: Use Destructuring Assignment with the Rest Parameter to Reassign Array Elements
|
||||
---
|
||||
## Use Destructuring Assignment with the Rest Operator to Reassign Array Elements
|
||||
## Use Destructuring Assignment with the Rest Parameter to Reassign Array Elements
|
||||
Remember that the rest parameter allows for variable numbers of arguments. In this challenge, you have to get rid of the first two elements of an array.
|
||||
|
||||
Remember that the rest operator allows for variable numbers of arguments. In this challenge, you have to get rid of the first two elements of an array.
|
||||
|
||||
## Hint 1:
|
||||
## Hint 1:
|
||||
|
||||
Assign the first two elements to two random variables.
|
||||
|
||||
@@ -39,8 +38,8 @@ function removeFirstTwo(list) {
|
||||
// change code above this line
|
||||
return arr;
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
## Spoiler Alert - Solution Ahead!
|
||||
You can use random variables to omit the first two values:
|
||||
@@ -67,7 +66,7 @@ const source = [1,2,3,4,5,6,7,8,9,10];
|
||||
function removeFirstTwo(list) {
|
||||
"use strict";
|
||||
// change code below this line
|
||||
const [,,...arr] = list; // change this
|
||||
const [a, b, ...arr] = list;
|
||||
// change code above this line
|
||||
return arr;
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Use the Rest Operator with Function Parameters
|
||||
title: Use the Rest Parameter with Function Parameters
|
||||
---
|
||||
## Use the Rest Operator with Function Parameters
|
||||
## Use the Rest Parameter with Function Parameters
|
||||
|
||||
### Rest parameter explanation
|
||||
[Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters "Mozilla Developer Network")
|
||||
@@ -13,7 +13,7 @@ title: Use the Rest Operator with Function Parameters
|
||||
|
||||
<a href="http://www.youtube.com/watch?feature=player_embedded&v=iLx4ma8ZqvQ
|
||||
" target="_blank"><img src="http://img.youtube.com/vi/iLx4ma8ZqvQ/0.jpg"
|
||||
alt="Image of youtube video link spread and rest operator " width="240" height="180" border="10" /></a>
|
||||
alt="Image of youtube video link spread and rest parameter " width="240" height="180" border="10" /></a>
|
||||
|
||||
### Example
|
||||
This code
|
@@ -12,7 +12,7 @@ title: Use the Spread Operator to Evaluate Arrays In-Place
|
||||
### Video Explaining Spread Operator and Rest Parameter
|
||||
<a href="http://www.youtube.com/watch?feature=player_embedded&v=iLx4ma8ZqvQ
|
||||
" target="_blank"><img src="http://img.youtube.com/vi/iLx4ma8ZqvQ/0.jpg"
|
||||
alt="Image of youtube video link spread and rest operator " width="240" height="180" border="10" /></a>
|
||||
alt="Image of youtube video link spread and rest parameter " width="240" height="180" border="10" /></a>
|
||||
|
||||
### Information About apply() Method
|
||||
[Mozilla Developer Network Apply Method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply "Mozilla Developer Network")
|
||||
|
Reference in New Issue
Block a user