https://github.com/joelibaceta/30-seconds-of-ruby
A curated collection of useful Ruby snippets that you can understand in 30 seconds or less.
https://github.com/joelibaceta/30-seconds-of-ruby
Last synced: 2 months ago
JSON representation
A curated collection of useful Ruby snippets that you can understand in 30 seconds or less.
- Host: GitHub
- URL: https://github.com/joelibaceta/30-seconds-of-ruby
- Owner: joelibaceta
- Created: 2018-11-13T22:51:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T23:07:11.000Z (over 6 years ago)
- Last Synced: 2025-03-27T04:37:56.867Z (3 months ago)
- Size: 0 Bytes
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 30 seconds of code
> Note: This project is inspired by 30 Seconds of Code, but there is no affiliation with that project.
### 📚 Array
View contents
* [`any?`](#any?)
---
## 📚 Array### any?
Passes each element of the collection to the given block. The method returns `true` if the block ever returns a value other than `false` or `nil`.```ruby
%w[ant bear cat].any? { |word| word.length >= 3 } #=> true
%w[ant bear cat].any? { |word| word.length >= 4 } #=> true
[nil, true, 99].any? #=> true
```