Skip to content

Commit 9b9bcbf

Browse files
authored
Clarify that removeFromArray must always return an array (#602)
1 parent c113fc8 commit 9b9bcbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

foundations/08_removeFromArray/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exercise 08 - removeFromArray
22

3-
Implement a function that takes an array and some other arguments then removes the other arguments from that array:
3+
Implement a function that takes an array and some other arguments then removes the other arguments from that array, and returns the resulting array:
44

55
```javascript
66
removeFromArray([1, 2, 3, 4], 3); // should remove 3 and return [1,2,4]
@@ -12,7 +12,7 @@ See if you can make use of some built-in array methods in this exercise.
1212

1313
The first test on this one is fairly easy, but there are a few things to think about (or google) here for the later tests:
1414

15-
- you can manipulate the original array you pass into the function call or create a new array that is returned as the result.
15+
- you can manipulate the original array you pass into the function call or create a new array that is returned as the result, but the function should return the resulting array regardless of the approach.
1616
- how to remove a single element from an array
1717
- how to deal with multiple optional arguments in a JavaScript function
1818
- For more information, check out MDN's page on [function arguments](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) - scroll down to the bit about `Array.from` or the spread operator. You can also check out MDN's page on [rest parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).

0 commit comments

Comments
 (0)