It's the same reason why sometimes I avoid arrow functions in some of these courses because, although they are very cool, it's a little bit harder to understand what is going on. But, a lot of people do love them because they can be a lot more concise and it can be an advantage when you try to do something in a return statement or anytime a single line is going to look cleaner by using this operator. So, let's take a look at some code and see how you may use this in an actual project.
is equal to color amount... minus one. So, this is essentially what is right here... And I don't really need to have the parenthesis, but it may make it a little bit more readable. And so, this is the same thing as what I am testing. And then over here after the question mark, you would put what would happen if the result of that test is truthy. So, you would say here, whatever is right here, current color equals zero, we'll just copy and paste that.
And then, you use a colon, and then you would put whatever would happen if the test is false. So, this is the same right here as all this code and it's in a single line. If we delete this, so go ahead and delete that and then save this, refresh our page here and you can see that it works in exactly the same way. So, no different, but the code here obviously is a little less clear.
Skill Level Intermediate
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.