Skip to content

Instantly share code, notes, and snippets.

@abozhilov
Created June 21, 2013 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abozhilov/5830475 to your computer and use it in GitHub Desktop.
Save abozhilov/5830475 to your computer and use it in GitHub Desktop.
for-in
var obj = {prop1: "v1", prop2: "v2", prop3: "v3"};
var arr = [];
for (var i in obj) {
arr.push({
name : i,
value : obj[i]
})
}
console.log(arr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment