Seek and Destroy. From the beginning the function destroyer has one argument to pass. But when we call this function we pass 3 values in it.
See original GitHub issueChallenge Seek and Destroy has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function destroyer(arr,val1,val2,val3) {
// Remove all the values
//alert('sum=' + val1 +'another val2='+val2);
function identic(value){
return (value !== val1 );
}
function identic1(value){
return (value !== val2 );
}
function identic2(value){
return (value !== val3 );
}
arr = arr.filter(identic);
arr = arr.filter(identic1);
arr = arr.filter(identic2);
return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Seek and Destroy. From the beginning the function ... - GitHub
Seek and Destroy. From the beginning the function destroyer has one argument to pass. But when we call this function we pass 3...
Read more >freeCodeCamp Challenge Guide: Seek and Destroy
This is my solution here. Tried to make it simpler. function destroyer(arr) { // Remove all the values var targets = Array.prototype.slice.call( ...
Read more >freecodecamp Challenges- Seek and Destroy - Stack Overflow
Seek and Destroy You will be provided with an initial array (the first argument in the destroyer function), followed by one or more...
Read more >Seek and Destroy - freeCodeCamp Algorithm - Code Snippet
Learn how to solve the freeCodeCamp algorithm 'Seek and Destroy' using the Arguments Object and Array.prototype.splice() JavaScript methods.
Read more >Seek and Destroy - Medium
This is a tough challenge, make no mistake. But it's definately one you should understand fully moving on, because…
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
cc/ @FreeCodeCamp/issue-moderators
Shall we remove the
arr
argument from the function, as a gentle nudge towards thearguments
object?I think explicitly mentioning that you’re supposed to use the arguments object would be sufficient. Currently, the link to the MDN page is there, but campers know from challenges before that you don’t always have to use the content from the links. Adding this to the description could help clear up a lot of confusion while still having campers come up with the actual solution themselves.