Skip to content

Instantly share code, notes, and snippets.

@larzconwell
Created April 3, 2014 15:05
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 larzconwell/9956080 to your computer and use it in GitHub Desktop.
Save larzconwell/9956080 to your computer and use it in GitHub Desktop.
ports = [22, 80]
data = {ports: {}}
ports.forEach(function (p) {
var addr = 'localhost:' + p
data.ports[p] = addr // For some reason keys end up strings, event though p is a number.
})
console.log(data.ports)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment