Skip to content

Instantly share code, notes, and snippets.

@forrestgrant
Created June 3, 2014 12:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forrestgrant/7badac42f2afc8d75bd1 to your computer and use it in GitHub Desktop.
Save forrestgrant/7badac42f2afc8d75bd1 to your computer and use it in GitHub Desktop.
Swift - RubyMotion
numbers = [20, 19, 7, 12]
numbers.map { |n| 3 * n }
var numbers = [20, 19, 7, 12]
numbers.map({
(n: Int) -> Int in
let result = 3 * n
return result
})
@gertig
Copy link

gertig commented Jun 3, 2014

lol

@jacklynrose
Copy link

Swift has it's good parts too though :) But yes, Ruby love.

@Nitrillo
Copy link

Nitrillo commented Jun 6, 2014

I've only seen a WWDC video, but I think you can do:
numbers.map { 3 * $0 }

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