-
-
Save Li-Bot/2a58d53391dfbd4eb07eeebe85f3bfa6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swift | |
let celsius = fahrenheit.map { (degreesFahrenheit) -> Double in | |
return (degreesFahrenheit - 32.0) / 1.8 | |
} | |
// For-in loop | |
var celsius = [Double]() | |
for degreesFahrenheit in fahrenheit { | |
celsius.append((degreesFahrenheit - 32.0) / 1.8) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment