I'm trying to understand the reasoning behind why the language designers would make the for (.. in ..)
loops so verbose. For example:
for (var x in Drupal.settings.module.stuff) {
alert("Index: " + x + "\nValue: " + Drupal.settings.module.stuff[x]);
}
It makes trying to loop over anything semi-complex like the above a real pain as you either have to alias the value locally inside the loop yourself, or deal with long access calls. This is especially painful if you have two to three nested loops.
I'm assuming there is a reason why they would do things this way, but I'm struggling with the reasoning.
for(var i = 0; i < x.length(); i++)
.length
is a property, not a method.