Is my first time posting a page for assessment.
Is all the code right?
Thanks!
https://codepen.io/andreilet/pen/NWYvMQg
Hi @AndreiLet and welcome to the community
Well done! This works properly.
One thing you could consider is using a class on the button to decide about the state of the machine. This would decouple the button text from the machine state. I mention this because texts tend to change in real projects and changing the button text would automatically break the functionality. If we think even further: In a big project we may use different languages. Making the button work depending on the text in multiple languages would be even more brittle.
Of course all this doesn’t relate directly to this little exercise. It’s just my attempt to show you a possible bigger picture
Have a nice day,
Michael
PS: Your email address is visible in your post. It ended up in the optional “name” field of your profile. I recommend removing it.