Let's say someone asks how to get the average of all elements in an array using javascript and someone answers with:
function getAverage(array) {
var sum = 0;
for (var i = 0; i < array.length; i++) {
sum += array[i];
}
return sum / array.length;
}
And someone else answers with, I made a library for that (containing a link) and then posting the code:
library.average(array);
Does that answer the question or is it considered a link only answer because the algorithm to define the average is in another castle?
If that's allowed, how far can you actually go with that? If someone wants to know how to use a specific algorithm in javascript and someone writes a library just to handle that algorithm, would it be enough to share a link to that library and mention the code to solve it using the library, eg:
library.specificAlgorithm(data);
The reason I'm asking this is because you often see questions getting answered with, "you can use jQuery/Lodash/Underscore/Moment" with the relevant code to do that using the specific library and I don't think it's considered a bad answer. But then I read this answer and I'm seeing people comment that the relevant code should be posted as well.
library.specificAlgorithm(data);
and a reference to the library, it should not be considered as a link only answer but you can downvote it or vote to flag it for VLQ?