Trivial questions certainly deserve answers in my opinion. Some of the most read questions are pretty trivial, and sometimes only a few lines long.
Note, however, that both asking and answering a trivial question is very hard.
You may ask a trivial question if:
- It's broadly applicable (not overly localized)
- It's not based on a typo or simple misconception (those can be answered in the comments, and closed as off-topic)
- It's not a duplicate (very important! Most trivial questions have been asked and answered before)
- It's not overly trivial (e.g. how do I set a variable in my language-> wrong, how do I remove the first element of an array in my language-> right). Questions about elemental syntax require more of a tutorial than an answer, and therefore aren't really suitable for the site
- It's specific. The OP should have a single problem, and the rest of the code should work.
When answering a question that meets all these criteria (after checking for duplicates), make sure to post a thorough answer. Since the answer is trivial, a lot of people can probably answer it. Don't just state the obvious in a short section of code, but try to explain why and how, and evaluate multiple possibilities if there are a finite number of plausible answers.
Don't answer a question that should be closed! That sometimes keeps the roomba from auto-deleting it, sends a mixed message, and encourages the OP to post more similar questions (because he got his answer).
Let's take the current question:
- It's overly localized. Instead of asking "how do I multiply numbers", it specifically asks to multiply an input by 10, and then return the value.
- It's not specific. OPs sample code doesn't return values, so you will have to explain returning values too.
- It's base syntax, which makes for bad questions.
- It probably is a dupe.
- It's unclear. You assume OP means javascript because of the syntax in his question, but he might as well want a java answer but just doesn't know how to provide the relevant java sample code.
Each one of those reasons is a possible reason to close and not answer the question. All these things combined make the question of very low quality, and thus this question should be left downvoted, closed and unanswered.
coding-style
tag.