I have this variable:
var stars = this.parentNode.children
and its meaning:
[span.rate, span.rate, span.rate.rated, span.rate.rated, span.rate.rated]
Now I want to change it, but if I try:
stars.reverse()
I get
Uncaught TypeError: stars.reverse is not a functionupdateRateStar @ app.js:75(anonymous function) @ app.js:98
I cannot understand why it works with an array like:
[1,2,3]
So, if I try:
[1,2,3].reverse()
it works. So I can not understand the problem
source
share