I’m learning Elm for the first time, and I’m stuck on the exercise part of the buttons guide.
Exercise: Add a button to reset the counter to zero:
- Add a
Reset
variant to theMsg
type- Add a
Reset
branch in theupdate
function- Add a button in the
view
function.
Here is the code I came up with.
https://ellie-app.com/g2J95WJRTZGa1
The error I’m seeing is as follows
I was not expecting to see this equals sign:
55| model = 0
^
Maybe you want == instead? To check if two values are equal?
I’m not sure how to finish this exercise.
Is =
not for assignment? I wish the guide would show a completed example so I could see what I’m doing wrong.