question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Challenge 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:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Bounceycommented, Oct 21, 2016

cc/ @FreeCodeCamp/issue-moderators

Shall we remove the arr argument from the function, as a gentle nudge towards the arguments object?

1reaction
systimoticcommented, Nov 18, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found