Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Swift
let sum = fahrenheit.reduce(0.0) { (result, degreesFahrenheit) -> Double in
return result + degreesFahrenheit
}
// For-in loop
var sum: Double = 0.0
for degreesFahrenheit in fahrenheit {
sum += degreesFahrenheit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.