This isn't true at all though, because `for x in y` is invalid JS.
for (variable in object) {
statement
}
The only difference in Vue is not having to explicitly declare the variable. But so what?You said "strings are magic and not code" to which I said "all code is text so there are no magic strings". Now you and the other poster keep saying "well this string isn't the same syntax as JS" but I don't see what the point is. Why does it have to be valid JS?
Again, you can embed syntax within each other just fine. JSX has HTML tags inside JS. HTML has tags like <style> and <script> for other languages (regardless of what the default language is or what parses it).
So, for the last time, what's the actual argument?
for (variable in object) {
statement
}
And here's the syntax for Vue's for..in loop. Only one of it is somewhat Javascript: item in items
(item, index) in items
(val, key) in object
(val, name, index) in object
And, of course, there's an extension to that v-for="item in items" :key="item.id"
Edit: additionally, from that very link: "for...in should not be used to iterate over an Array where the index order is important." But this doesn't concern Vue, it maintains the order in its for..in.for...in iterates over the keys of an object, but for in in vue iterates over the elements of an array.
It is you who doesn't think that loop does what it actually does.
Please read the spec and verify with your favorite JS runtime before continuing this argument.
Also Vue's directives are not JS. It's a separate DSL. I've repeated this enough so I'll end this discussion here.