mirror of
https://github.com/jbranchaud/til
synced 2026-01-08 01:28:02 +00:00
Update are-they-all-true.md
This commit is contained in:
@@ -3,10 +3,10 @@
|
|||||||
There is a method on `Enumerable` that allows you to check against
|
There is a method on `Enumerable` that allows you to check against
|
||||||
everything in a collection. This is the `all?` method.
|
everything in a collection. This is the `all?` method.
|
||||||
For instance, if you want to check if an array of values are all
|
For instance, if you want to check if an array of values are all
|
||||||
true, you can call it without arguments:
|
truthy, you can call it without arguments:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
> [true, true, true].all?
|
> [true, 1, ''].all?
|
||||||
# true
|
# true
|
||||||
> [true, false, true].all?
|
> [true, false, true].all?
|
||||||
# false
|
# false
|
||||||
|
|||||||
Reference in New Issue
Block a user