-14

Just 2 days ago my answer got deleted by one of the moderators. I remember that previously the reason for the cleanup was stated at the bottom of the post.

I haven't got any objection, I only want to know why it got deleted.

My answer:

screenshot showing the deleted answer

2
  • 12
    This is just a guess but I think the moderator was simply cleaning up the question. That particular question has 205 answers (I believe this count includes the deleted answers). If you see the current undeleted answers the technique your answer used is already present there. We don't need so many duplicate answers. Commented Dec 4 at 8:29
  • 1
    @AbdulAzizBarkat This answer was very likely deleted as a duplicate as I went through this question and flagged 50 or so duplicate answers (this included) and my flag for this was marked helpful. Commented Dec 5 at 22:49

1 Answer 1

35

Both .splice() and .filter() solutions exist from years before your answer. Here are the first three answers for each approach:

For .splice():

  1. First answer ever posted from 2011-04-23: https://stackoverflow.com/a/5767332
  2. Second answer from 2011-04-23: https://stackoverflow.com/a/5767335
  3. Third answer posted, also 2011-04-23 - it is currently the highest voted and accepted: https://stackoverflow.com/a/5767357

And more.

For .filter():

  1. From 2012-10-18: https://stackoverflow.com/a/12952256
    • Note how it uses a regular function
  2. From 2014-02-10: https://stackoverflow.com/a/21688894
  3. From 2015-04-09: https://stackoverflow.com/a/29535421

And more.

And the ES6 mention is completely irrelevant to the answer - the only ES6 code you have is the arrow function in the .filter() call. Your hint is completely wrong anyway: most likely you are advising against people using

function(e) { e !== 3 }

which - yes, would not work, but no, it is not because of the arrow function but because the correct code is:

function(e) { return e !== 3 }

let arr = [1, 2, 3, 4];
arr = arr.filter(function(e){ return e !== 3 }); // -> arr became [1, 2, 4]

console.log(arr);

The answer is duplicated and also misleading. There are A LOT of duplicate and misleading answers in that Q&A. There are 4 full pages of visible answers (30 per page + 9 visible answers on page 5 = 129 visible answers). Out of 205 (-129 = 76 deleted answers).

Every few weeks somebody decides to add yet another thing that either has been explained way better a decade ago, or just their own take on the question which does not really answer it. We normal users cannot deal with all of this ourselves. I applaud moderators taking action against answers that are not needed there.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .