Skip to content

Instantly share code, notes, and snippets.

@passy
Created March 1, 2010 11:33
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 passy/318289 to your computer and use it in GitHub Desktop.
Save passy/318289 to your computer and use it in GitHub Desktop.
var myObject = {
a: 42,
b: 140,
c: 'hello'},
key,
result = [];
for (key in myObject) {
if (myObject.hasOwnProperty(key)) {
result.push({
name: key,
value: myObject[key]
});
}
}
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment