Is there any action that can be taken against such behavior?
Why would there be? These downvotes were correct, and in fact praise-worthy.
If no, I would suggest at least revealing who downvoted.
Absolutely not. This is perhaps the single-most requested feature on Meta, and it will be roundly rejected every time - because it completely misses the point.
In that case the spam's author could be seen and reported...
There is nothing to report - again, this is not only perfectly acceptable use of the site, but in fact laudable.
It is also not "spam", as far as we are concerned. We are extremely concerned with preventing people from abusing the site to post ads for goods and services. However, generally speaking, "doing the same thing a lot" is only bad if the thing itself is bad.
I understand that all of this must seem counterintuitive to you. This is because you have the same complete misunderstanding about what Stack Overflow is that most new users (and even quite a few established ones) do.
Stack Overflow is not social media; as such, there is no expectation to have a positive-by-default attitude, as we are judging content, not authors.
Stack Overflow is not a help desk; questions need to be actually questions, not a code dump followed by "help me please", and when the underlying question is something that has been addressed before, we close it as a duplicate. (We do not care that OP phrased things differently or has slightly different practical requirements; what matters is the underlying question and the answers to that question.)
The purpose of questions on Stack Overflow is not to solve the issue OP is encountering, but instead to build a high-quality, searchable Q&A library. This requires questions to be properly focused on a single problem, and thus searchable. High-quality answers require high-quality questions; without that, they can at best be high-quality lecture material, which is not what we offer here. Answers to questions that don't meet site standards are inherently not useful and even counter-productive (as they interfere with the process of improving salvageable questions and also with the process of deleting hopeless ones). For all I know (because I did not try the code), maybe OP had a perfectly fine approach to the problem, and failed only because the code tries to fix the el
key of the objects but should actually work with the y
key instead (we would consider this a typo).
All the answers shown here are effectively code-only; they say almost nothing about how they approach the problem, how to understand the code, what was wrong with the original approach (which, granted, is hard to do since OP didn't describe what went wrong - this is part of why high-quality questions are so important!) or anything else. Simply being "correct" as judged by OP is nowhere near sufficient.