Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
читается, просто вы еще не потратили много времени на кодирование
This comment is hidden because it contains spoiler information about the solution
Depends what country you're in.
Переделывай - это хуйня не читаемая!
the interesting thing is that in real life yellow goes past red, not green :D
It's a complete misuse of ternary operators. You should only use ternary operators when you're going to return something with it.
it is advised not to use nested ternary operators because it might easily get confusing :) at least, that is what i learned
I did not even know you could nest ternary operators like this.
Is it really best for a traffic light to go 'green' as the default case?
Agreed. This solution only works because the cyclical state-change happens to only have 3 states. Rhetorically, how would it look if you had a traffic light with 10 colors?
Seems legit
In my opinion this is no best practice, because nesting a tenary operator in another one results in code that is very hard to read.