Created
July 4, 2017 08:17
-
-
Save tranhieutt/859ccb047baf1200234a79c119bf0915 to your computer and use it in GitHub Desktop.
[Swift] - reduce
This file contains hidden or 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
let items = [2.0, 4.0, 6.0, 8.0] | |
let total = items.reduce(10.0,+) | |
//Console: 30.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment