Skip to content
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

simplify looping construct #4

Open
jmjpro opened this issue Mar 7, 2013 · 0 comments
Open

simplify looping construct #4

jmjpro opened this issue Mar 7, 2013 · 0 comments

Comments

@jmjpro
Copy link

jmjpro commented Mar 7, 2013

The looping construct was non-intuitive and I only figured it with a little trial and error and reading your code. To loop through all the colors in your color example I was only successful with the following:

var colors;
for( var i in color.symbols() ) {
    var colorInstance = color.symbols()[i];
    colors += colorInstance.name + ':' + colorInstance.de + '<br/>';
}

Intuitively I thought the looping would be like this:

var colors;
for( var colorInstance in color ) {
    colors += colorInstance.name + ':' + colorInstance.de + '<br/>';
}

My knowledge of javascript is not sufficient to determine whether or not it's possible for enums.js to support that looping construct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant