There are a myriad of questions saying "My code doesn't work" without any mention as to the the error they are getting in their debuggers/consoles etc..
I suspect that in most cases, the OP doesn't even know how to use a debugger/console (which is hidden to a person just starting out in JS for example, where a compiler is not present to alert him).
So what they see is usually their code not working for no (apparent) reason and without any knowledge that if they press F12(case for JS) they can see where the bug is.
The answers on this type of questions are usually code fixes - They don't address the core issue that is that the OP doesn't even know what/how to use a debugger.
If we provide just code fixes they'll stay oblivious to it's usefulness/purpose and ask another question later on that is just as basic/localised as the one they just asked.
Should answers like that just be provided code fixes or is there a different mechanism we can use?
Ideally, it would be better if we could prevent the question from being asked in the first place (hopefully the OP solves the issue on his own). This frees up resources to answer questions that have a more perplexing problem to solve.
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, **a specific problem or error** and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers.
[ask]
.