Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Print factorials 1!, 2!, ..., 10!
- val factorial: Int => Int = x => 1 to x reduce (_*_)
- 1 to 10 map factorial foreach println
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement