Interactive Elixir (1.1.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> list = [1, 2, 3]
[1, 2, 3]
iex(2)> new_list = [ 0 | list ]
[0, 1, 2, 3]
iex(3)> [ head | tail ] = new_list
[0, 1, 2, 3]
iex(4)> head
0
iex(5)> tail
[1, 2, 3]
iex(6)>
Created
April 17, 2015 05:03
-
-
Save edubkendo/16da5462842af082fb8c to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment