Skip to content

Instantly share code, notes, and snippets.

@kaichen
Created December 21, 2010 02:16
Show Gist options
  • Select an option

  • Save kaichen/749384 to your computer and use it in GitHub Desktop.

Select an option

Save kaichen/749384 to your computer and use it in GitHub Desktop.

== Javascript

~ » node
> console.log([1,2,3].map(function(n){n*2}))
[ undefined, undefined, undefined ]
> console.log([1,2,3].map(function(n){return n*2}))
[ 2, 4, 6 ]

== Ruby

~ » irb
>> [1,2,3].map{|n| n*2}
=> [2, 4, 6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment