Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scala> val l = 1 to 10
- l: scala.collection.immutable.Range.Inclusive = Range(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
- scala> l.forall(x => x > 0)
- res0: Boolean = true
- scala> l.forall(x => x > 1)
- res1: Boolean = false
- scala> l.exists(x => x < 1)
- res2: Boolean = false
- scala> l.exists(x => x < 2)
- res3: Boolean = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement