1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-16 13:38:02 +00:00

Merge pull request #25 from dcki/patch-1

Update are-they-all-true.md with truthy values
This commit is contained in:
Josh Branchaud
2016-02-14 11:35:56 -06:00

View File

@@ -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