Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
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
//reduce | |
//Use reduce to combine all items in a collection to create a single new value. | |
let numbers = [1, 3, 5, 7, 9] | |
//sum all values from the array (+) | |
let result = numbers.reduce(0, +) | |
//sum all values from the array (+) plus one | |
let result2 = numbers.reduce(1, +) | |
let result3 = numbers.reduce(1, *) |