Created
July 30, 2020 11:02
-
-
Save qhwa/bf5b5423157419b3b625f29149c6edd9 to your computer and use it in GitHub Desktop.
Check numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Bitwise | |
even? = fn number -> | |
(number &&& 1) == 0 | |
end | |
0..20 | |
|> Enum.filter(even?) | |
#=> [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment