I was looking how to get first element of an array or get nil if the array is empty.
Python library doesn't provide this kind of functionality.
https://stackoverflow.com/questions/363944/python-idiom-to-r... offers multiple ugly ways of doing it.
For Ruby, we use `.first`.
In Ruby, the standard library is richer. A lot of libraries are "official" because Rails uses it.
I was looking how to get first element of an array or get nil if the array is empty.
Python library doesn't provide this kind of functionality.
https://stackoverflow.com/questions/363944/python-idiom-to-r... offers multiple ugly ways of doing it.
For Ruby, we use `.first`.
In Ruby, the standard library is richer. A lot of libraries are "official" because Rails uses it.