Skip to content

Instantly share code, notes, and snippets.

@kid-icarus
Created November 27, 2013 22:45
Show Gist options
  • Save kid-icarus/7684435 to your computer and use it in GitHub Desktop.
Save kid-icarus/7684435 to your computer and use it in GitHub Desktop.
For jorybro
var derp = {foo: 3, bar: 3};
var merp= [];
console.log(derp);
for (var name in derp) {
if (derp.hasOwnProperty(name)) {
for (var i = 0; i < derp[name]; i++) {
merp.push(name);
}
}
}
console.log(merp);
@talon
Copy link

talon commented Nov 27, 2013

//coffescript
derp =
  foo: 3
  bar: 3

merp = []
console.log derp
for name of derp
  if derp.hasOwnProperty(name)
    i = 0

    while i < derp[name]
      merp.push name
      i++
console.log merp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment