Skip to content

Instantly share code, notes, and snippets.

@Li-Bot
Created March 6, 2020 06:42
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 Li-Bot/59edd4689bb4216916252cc9c8f8361e to your computer and use it in GitHub Desktop.
Save Li-Bot/59edd4689bb4216916252cc9c8f8361e to your computer and use it in GitHub Desktop.
// Swift
let fahrenheit = fahrenheits.flatMap({ (fahrenheit) -> [Double] in
return fahrenheit
})
// For-in loop
var fahrenheit = [Double]()
for lFahrenheit in fahrenheits {
fahrenheit.append(contentsOf: lFahrenheit)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment