I wanted to ask first before doing a potentially risky edit to the 6th top score question of How to check whether a string contains a substring in JavaScript?, the thing is that the question unnecessary inserted a wall of code that was added after trying one of the answers as an "update" in his question after failing to make it work because of a simple typo (see revision #3 more problems).

To my eyes, making people read this unnecessary huge update, to later see that it was just a one-character typo is unacceptable.

If the code were posted exactly at the time of asking, I know it would be bad to fix it or remove it, but this is not the case as it was submitted through one of those hated "updates" and the question is still valid without it.

But my concern about the impact of the edit is that more cleaning will be necessary as there are comments 1 (and more) and answers 1 2 3 that only address this part.

Any thoughts?

  • My answer was #3, I made an edit to reflect the edit of the question.
    – Travis J
    Dec 5, 2013 at 21:21

1 Answer 1


The question is no longer interesting to the OP (other than as a never-ending rep-donor). Go for it and change it in such a way it helps the community.

Then, either flag one comment so that mods remove all of them; or just don't care, since comments are not very important.

Even if the post contained the long code at the beginning, the above still applies: it serves the community, so if the code is irrelevant, it should be removed.

  • 1
    What to do about the answers based on the code? Delete them? Dec 5, 2013 at 20:07
  • @ThisSuitIsBlackNot Of the first 10 answers, as far as I see, only one directly refers the typo in indexOf. Is it a big deal? I don't think so.
    – yo'
    Dec 5, 2013 at 20:09
  • Since the authors wouldn't lose rep, I guess it wouldn't be such a big deal. Dec 5, 2013 at 20:16
  • @ThisSuitIsBlackNot I basically wanted to say that I don't know. IMHO it's ok for them to stay there, since the reasonable answers are more on the top.
    – yo'
    Dec 5, 2013 at 20:17

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