Your Turn

  • Exercise: PatternMatching-1

    Which of the following will match?

    • a = [1, 2, 3]
    • a = 4
    • 4 = a
    • [a, b] = [ 1, 2, 3 ]
    • a = [ [ 1, 2, 3 ] ]
    • [a] = [ [ 1, 2, 3 ] ]
    • [[a]] = [ [ 1, 2, 3 ] ]

Get Programming Elixir 1.3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.