Unexpected Behavior of "if" statement when using "=" to test for equality
That is the question. The problem encountered by the OP was that they used if( a = b )
as opposed to if( a == b)
.
The situation was properly outlined in the body of the question. However, this should have been immediately obvious, and changing one =
doesn't seem to me to be exactly of value.
Recently, it was pointed out in the post Did Google recently update algorithms in a way that's bad for Stack Overflow questions? that Stack Overflow's SEO ranking dropped due to an update of google's algorithm (although the exact metric is hard to pin point).
I think questions like the one linked at the top are contributing to this. It has absolutely no value from a search perspective. "Javascript working only once" could mean almost anything.
Editing the title would need to reflect some aspect of the post, but the post is literally about the difference in using =
versus ==
, although the OP doesn't know that.
Not only is this question unlikely to actually help any future visitors, it seems troubling for it to remain. I have downvoted and voted to close, but since the title is so vague it wont get enough attention to be removed.
It also seems troubling to reward questions like these with answers, it received 3. I know that recently the outlook has been
If you understand what the OP is asking, and the question is reasonably answerable, then answer it. Robert Harvey♦
So, while I am sure this will bring attention to the post in question, I am more curious what to do in the future.
- How can these types of posts be disposed of more quickly? Posting on meta for every one both clutters meta and lacks efficiency.
- I know that it has low traffic, should I edit it into a form which reflects what it really is (even though that will cast the OP as perhaps asking an obvious question)?
- Do I just ignore these, downvote and move on as the motto is? Because this seems to leave a lot of cruft around (remember the close vote review queue?)