Summary
We've covered a lot of ground in this chapter. We learned:
How to use variables.
How to call functions.
How to use
if/else
statements and their counterpart,unless
.How to use natural-language aliases to make our comparison statements more readable.
How to declare arrays, and iterate through their contents in a number of different ways.
How to declare and iterate over objects.
Not only did we learn about all those things, but we made sure to avoid a few common mistakes, and learned why it was possible to make those mistakes. We've compared many of the CoffeeScript statements to the compiled JavaScript, so hopefully you're developing a good mental map of how CoffeeScript translates to JavaScript.
Now that we've got a solid handle on the basics, we're ready to start building our application. In the next chapter, we'll begin development of a small web application to help manage a pet shop. We'll need all of the skills we learned in this chapter, and we'll be learning a few more as we work!