Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Object JavaScript -- Looping through properties
var myHelloObj = {
prop1:"hello",
prop2:"hello2",
prop3:new Array("helloa",1,2)
}
for(x in myHelloObj console.log( x + "-" + myHelloObj [ x ] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment