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

for-in used incorrectly #1

Closed
djensen47 opened this issue May 5, 2015 · 1 comment
Closed

for-in used incorrectly #1

djensen47 opened this issue May 5, 2015 · 1 comment

Comments

@djensen47
Copy link
Contributor

On approximately line 101 a for-in loop is used incorrectly. It should be a standard for loop or use the forEach function on Array.

        var zones = vehicle.climateControl.zones;
        for(var i in zones)
        {
           if(i.equals(zone.driver))
           {
              var value = {};
              value["acStatus"] = true;
              vehicle.climateControl.set(value, zone.driver).then(function(){
                console.log("successfully set acStatus");
             },
             function(error) {
               console.log("there was an error");
             });
           }
        }

for-in is for iterating over properties in an object

@djensen47 djensen47 changed the title for-in not used correctly for-in used incorrectly May 6, 2015
@djensen47
Copy link
Contributor Author

djensen47 added a commit to djensen47/automotive that referenced this issue May 26, 2015
Fixes javascript in the introduction section

- Changes the for-in loop to a for-loop
- Fixes inconsistent indentation
- Fixes curly braces on new line
wonsuk73 added a commit that referenced this issue Apr 15, 2017
Added timestamp to getVSS interfaces part

tguild pushed a commit that referenced this issue Jan 7, 2019
Synching with upstream.
PatrickCQ added a commit that referenced this issue Feb 12, 2019
Merge pull request #288 from PatrickCQ/gh-pages
tguild pushed a commit that referenced this issue Sep 8, 2020
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