-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object iterator #138
Comments
The format of the 'for' example you have suggested normally would have $ix equal to the current array element's 'value' not it's 'index'. But otherwise a good idea. |
It's important to get the key - think this is what you are saying. For arrays it doesn't matter so much, but for non-arrays the data in the key may be significant and not present in the data object. |
Plain arrays are indexed using an integer. eg $list[2] If you want to loop through the keys of an Associative array I would suggest:
|
OK, that would be a good way of doing it. Just have to remember to put a copy in the wiki if it gets implemented. |
Can we get a simple loop mechanism to iterate over the properties of a javascript object?
This would make it a lot easier and more efficient to process arrays and dictionaries.
If $jvar isn't a java script object, there should be an error message.
If $jvar is a proper array, $ix should run over just the valid numerical keys (0 to $jvar.length - 1)
Otherwise $ix run through the complete list of properties defined for the object.
The text was updated successfully, but these errors were encountered: