Search⌘ K

Running the Examples

Explore how to run code examples in Elixir projects using IEx sessions for simple commands and a built-in playground for more complex scripts. Learn how to reset your database sample data to maintain a clean and consistent environment as you practice.

How to run code snippets

To run the code snippets included in the course locally, we have two options.

The IEx session

We can open up an IEx session with iex -S mix and type or copy/paste the code directly into the console. This works great for one- or two-line examples. Here we are going to test the hello-world code of Elixir.

Elixir
IO.puts "Hello, World!"

The output will be like this:

widget

Try it

...