Elixir: How to test multiple values in case condition?
There’s no direct syntax for or in the middle of patterns but you can use a guard: case testvalue do n when n in [200, 400] -> true _ -> false end You can also use or in guards. This will work too but is more verbose: case testvalue do n when n == 200 … Read more