Skip to content

Comments

Iterating over the enumerable properties of an object#281

Closed
hemanth wants to merge 3 commits intojquery:masterfrom
hemanth:master
Closed

Iterating over the enumerable properties of an object#281
hemanth wants to merge 3 commits intojquery:masterfrom
hemanth:master

Conversation

@hemanth
Copy link
Contributor

@hemanth hemanth commented Mar 1, 2013

Should go the loop section?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution :) However, this code produces an error: ReferenceError: key is not defined. Also, please make sure you're following the style guide with any code contributions -- you'll want to address the spacing in the for loop. Finally, you may want to show how to log both the key and the value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps! I was testing in the console and was logging as key, then wondered key wont sound good and added prop!
Yup will send in a new P.R.

for ( var prop in myObject ) { 
  console.log("Property : "+prop+" ; value : "+myObject[prop]); 
}

@rmurphey Something like ^ seems fine?

@ajpiano
Copy link
Member

ajpiano commented Mar 14, 2013

This PR appears to be superseded by #282

@ajpiano ajpiano closed this Mar 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants